package cn.com.headfree.userinfo.dao.impl;

import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import cn.com.headfree.entity.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;

import com.gta.edu.sdk.base.dao.impl.BaseDaoImpl;
import com.gta.edu.sdk.common.dto.Page;
import com.gta.edu.sdk.util.StringUtil;

import cn.com.headfree.entity.isc.User;
import cn.com.headfree.userinfo.dao.IUserInfoDao;
import cn.com.headfree.vo.DeptIdPathVo;
import cn.com.headfree.vo.EachTypeDetailVo;
import cn.com.headfree.vo.FuturePostVo;
import cn.com.headfree.vo.SysDictionaryInfoVo;
import cn.com.headfree.vo.TEmpBaseInfoVo;
import cn.com.headfree.vo.complex.TAcadeAchiveInfoVo;
import cn.com.headfree.vo.complex.TPatentInfoVo;
import cn.com.headfree.vo.complex.TProjAchieveInfoVo;
import cn.com.headfree.vo.complex.TStandInfoVo;
import cn.com.headfree.vo.complex.TTecInnovInfoVo;
import cn.com.headfree.vo.complex.TTecManInnovVo;

@Repository("userInfoDao")
public class UserInfoDaoImpl extends BaseDaoImpl<TEmpBaseInfo> implements IUserInfoDao {

	@Override
	public void addBaseInfo(TEmpBaseInfo baseInfo) {
		String sql = "insert into t_emp_base_info (id,erp_no,name,sex,birth_date,nation,birth_place,born_place,politi_status,id_card_no,mobile_phone,level,salary_grade,party_date,job_date,unit,dept,cur_post,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{erp_no,jdbcType=VARCHAR},")
				.append("#{name,jdbcType=VARCHAR},").append("#{sex,jdbcType=VARCHAR},")
				.append("#{birth_date,jdbcType=DATE},").append("#{nation,jdbcType=VARCHAR},")
				.append("#{birth_place,jdbcType=VARCHAR},").append("#{born_place,jdbcType=VARCHAR},").append("#{politi_status,jdbcType=VARCHAR},")
				.append("#{id_card_no,jdbcType=VARCHAR},").append("#{mobile_phone,jdbcType=VARCHAR},")
				.append("#{level,jdbcType=VARCHAR},").append("#{salary_grade,jdbcType=VARCHAR},")
				.append("#{party_date,jdbcType=DATE},").append("#{job_date,jdbcType=DATE},")
				.append("#{unit,jdbcType=VARCHAR},").append("#{dept,jdbcType=VARCHAR},")
				.append("#{cur_post,jdbcType=VARCHAR},").append("#{creater_id,jdbcType=VARCHAR},")
				.append("#{creater_name,jdbcType=VARCHAR},").append("#{create_time,jdbcType=DATE},")
				.append("#{updater_id,jdbcType=VARCHAR},").append("#{updater_name,jdbcType=VARCHAR},")
				.append("#{update_time,jdbcType=DATE},").append("#{del_sign,jdbcType=INTEGER},")
				.append("#{is_valid,jdbcType=INTEGER},").append("#{audit_state,jdbcType=INTEGER},").append("#{orignal_id,jdbcType=VARCHAR},")
		        .append("#{flow_status,jdbcType=INTEGER},").append("#{business_type_id,jdbcType=VARCHAR},")
				.append("#{isc_user_id,jdbcType=VARCHAR},").append("#{primitive_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", baseInfo.getId());
		params.put("erp_no", baseInfo.getErpNo());
		params.put("name", baseInfo.getName());
		params.put("sex", baseInfo.getSex());
		params.put("birth_date", baseInfo.getBirthDate());
		params.put("nation", baseInfo.getNation());
		params.put("birth_place", baseInfo.getBirthPlace());
		params.put("born_place", baseInfo.getBornPlace());
		params.put("politi_status", baseInfo.getPolitiStatus());
		params.put("id_card_no", baseInfo.getIdCardNo());
		params.put("mobile_phone", baseInfo.getMobilePhone());
		params.put("level", baseInfo.getLevel());
		params.put("salary_grade", baseInfo.getSalaryGrade());
		params.put("party_date", baseInfo.getPartyDate());
		params.put("job_date", baseInfo.getJobDate());
		params.put("unit", baseInfo.getUnit());
		params.put("dept", baseInfo.getDept());
		params.put("cur_post", baseInfo.getCurPost());
		params.put("creater_id", baseInfo.getCreaterId());
		params.put("creater_name", baseInfo.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", baseInfo.getUpdaterId());
		params.put("updater_name", baseInfo.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", baseInfo.getDelSign());
		params.put("is_valid", baseInfo.getIsValid());
		params.put("audit_state", baseInfo.getAuditState());
		params.put("orignal_id", baseInfo.getOrignalId());
		params.put("flow_status",baseInfo.getFlowStatus());
		params.put("business_type_id",baseInfo.getBusinessTypeId());
		params.put("isc_user_id",baseInfo.getIscUserId());
		params.put("primitive_id",baseInfo.getPrimitiveId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public TEmpBaseInfo getBaseInfoById(String id) {
		String sql = //" select id,erp_no,name,sex,GET_DIC('Gender',sex) as sex_name,birth_date,nation, " +
				" select t.*," +
				" GET_DIC('Gender',sex) as sex_name, " +
				" GET_DIC('Nation',nation) as nation_name,id_card_no,politi_status, " +
				" GET_DIC('PoliticalLandscapeText',politi_status) as politi_status_name, " +
				" mobile_phone,level,salary_grade,party_date,job_date,cur_post,real_post,future_post from t_emp_base_info t where t.id = ? and t.del_sign = '0' ";
		return this.findUnique(TEmpBaseInfo.class, sql, new Object[] { id });
	}

	@Override
	public TEmpBaseInfo getBaseInfoByErpNo(String erpNo) {
		String sql = //" select id,erp_no,name,sex,GET_DIC('Gender',sex) as sex_name,birth_date,nation, " +
				" select t.*," +
				" GET_DIC('Nation',nation) as nation_name,id_card_no,politi_status, " +
                " GET_DIC('Gender',sex) as sex_name, " +
                " GET_DIC('PoliticalLandscapeText',politi_status) as politi_status_name, " +
                " mobile_phone,level,salary_grade,party_date,job_date,cur_post,real_post,future_post from t_emp_base_info t where t.erp_no= ?  and  t.is_valid='0' and t.del_sign = '0' ";
		return this.findUnique(TEmpBaseInfo.class, sql, new Object[] { erpNo });
	}

	@Override
	public void addYearEffect(TYearEffectInfo yearEffectInfo) {
		String sql = "insert into t_year_effect_info (id,erp_no,user_name,id_card_no,rate_year_start,rate_year_end,rate_year,perfor_grade,resi_inte,cur_inte,org_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{erp_no,jdbcType=VARCHAR},")
				.append("#{user_name,jdbcType=VARCHAR},").append("#{id_card_no,jdbcType=VARCHAR},")
				.append("#{rate_year_start,jdbcType=DATE},").append("#{rate_year_end,jdbcType=DATE},")
				.append("#{rate_year,jdbcType=INTEGER},").append("#{perfor_grade,jdbcType=VARCHAR},")
				.append("#{resi_inte,jdbcType=DOUBLE},").append("#{cur_inte,jdbcType=DOUBLE},").append("#{org_id,jdbcType=VARCHAR},")
				.append("#{creater_id,jdbcType=VARCHAR},").append("#{creater_name,jdbcType=VARCHAR},")
				.append("#{create_time,jdbcType=DATE},").append("#{updater_id,jdbcType=VARCHAR},")
				.append("#{updater_name,jdbcType=VARCHAR},").append("#{update_time,jdbcType=DATE},")
				.append("#{del_sign,jdbcType=INTEGER},").append("#{is_valid,jdbcType=INTEGER},")
				.append("#{audit_state,jdbcType=INTEGER},").append("#{orignal_id,jdbcType=VARCHAR},")
				.append("#{flow_status,jdbcType=INTEGER},").append("#{business_type_id,jdbcType=VARCHAR},")
				.append("#{isc_user_id,jdbcType=VARCHAR},").append("#{primitive_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", yearEffectInfo.getId());
		params.put("erp_no", yearEffectInfo.getErpNo());
		params.put("user_name", yearEffectInfo.getUserName());
		params.put("id_card_no", yearEffectInfo.getIdCardNo());
		if(null==yearEffectInfo.getRateYearStart() && null!=yearEffectInfo.getRateYear()){
			params.put("rate_year_start", yearEffectInfo.getRateYear() + "-01-01");
		}else{
			params.put("rate_year_start", yearEffectInfo.getRateYearStart());
		}
		if(null==yearEffectInfo.getRateYearEnd() && null!=yearEffectInfo.getRateYear()){
			params.put("rate_year_end", yearEffectInfo.getRateYear() + "-12-31");
		}else{
			params.put("rate_year_end", yearEffectInfo.getRateYearEnd());
		}
		params.put("rate_year", yearEffectInfo.getRateYear());
		params.put("perfor_grade", yearEffectInfo.getPerforGrade());
		params.put("resi_inte", yearEffectInfo.getResiInte());
		params.put("cur_inte", yearEffectInfo.getCurInte());
		params.put("org_id", yearEffectInfo.getOrgId());
		params.put("creater_id", yearEffectInfo.getCreaterId());
		params.put("creater_name", yearEffectInfo.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", yearEffectInfo.getUpdaterId());
		params.put("updater_name", yearEffectInfo.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", yearEffectInfo.getDelSign());
		params.put("is_valid", yearEffectInfo.getIsValid());
		params.put("audit_state", yearEffectInfo.getAuditState());
		params.put("orignal_id", yearEffectInfo.getOrignalId());
		params.put("flow_status",yearEffectInfo.getFlowStatus());
		params.put("business_type_id",yearEffectInfo.getBusinessTypeId());
		params.put("isc_user_id",yearEffectInfo.getIscUserId());
		params.put("primitive_id",yearEffectInfo.getPrimitiveId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public void addPersonYearPoint(TPersonYearPoint personYearPoint) {
		String sql = "insert into t_person_year_point (id,salary_id,erp_no,user_name,org_id,dept_id,dept_name,year,last_year_point,year_point,trim_point,trim_reason,use_point,use_reason," +
				"remain_point,salary_grade,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{salary_id,jdbcType=VARCHAR},")
				.append("#{erp_no,jdbcType=VARCHAR},").append("#{user_name,jdbcType=VARCHAR},")
				.append("#{org_id,jdbcType=VARCHAR},").append("#{dept_id,jdbcType=VARCHAR},")
				.append("#{dept_name,jdbcType=VARCHAR},").append("#{year,jdbcType=INTEGER},")
				.append("#{last_year_point,jdbcType=DOUBLE},").append("#{year_point,jdbcType=DOUBLE},")
				.append("#{trim_point,jdbcType=DOUBLE},").append("#{trim_reason,jdbcType=VARCHAR},")
				.append("#{use_point,jdbcType=DOUBLE},").append("#{use_reason,jdbcType=VARCHAR},")
				.append("#{remain_point,jdbcType=DOUBLE},").append("#{salary_grade,jdbcType=VARCHAR},")
				.append("#{creater_id,jdbcType=VARCHAR},").append("#{creater_name,jdbcType=VARCHAR},")
				.append("#{create_time,jdbcType=DATE},").append("#{updater_id,jdbcType=VARCHAR},")
				.append("#{updater_name,jdbcType=VARCHAR},").append("#{update_time,jdbcType=DATE},")
				.append("#{del_sign,jdbcType=INTEGER})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", personYearPoint.getId());
		params.put("salary_id", personYearPoint.getSalaryId());
		params.put("erp_no", personYearPoint.getErpNo());
		params.put("user_name", personYearPoint.getUserName());
		params.put("org_id", personYearPoint.getOrgId());
		params.put("dept_id", personYearPoint.getDeptId());
		params.put("dept_name", personYearPoint.getDeptName());
		params.put("year", personYearPoint.getYear());
		params.put("last_year_point", personYearPoint.getLastYearPoint());
		params.put("year_point", personYearPoint.getYearPoint());
		params.put("trim_point", personYearPoint.getTrimPoint());
		params.put("trim_reason", personYearPoint.getTrimReason());
		params.put("use_point", personYearPoint.getUsePoint());
		params.put("use_reason", personYearPoint.getUseReason());
		params.put("remain_point", personYearPoint.getRemainPoint());
		params.put("salary_grade", personYearPoint.getSalaryGrade());
		params.put("creater_id", personYearPoint.getCreaterId());
		params.put("creater_name", personYearPoint.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", personYearPoint.getUpdaterId());
		params.put("updater_name", personYearPoint.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", personYearPoint.getDelSign());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public TYearEffectInfo getYearEffectById(String id) {
		String sql = " select t.*,GET_DIC('PerformLevelRecentThreeYears',perfor_grade) as perfor_grade_name " +
				" from t_year_effect_info t  where t.id= ? and t.del_sign = '0'  ";
		return this.findUnique(TYearEffectInfo.class, sql, new Object[] { id });
	}


	@Override
	public List<TYearEffectInfo> getYearEffectByErpNo(String erpNo){
		StringBuilder sqlBuilder = new StringBuilder("select t.*,GET_DIC('PerformLevelRecentThreeYears',perfor_grade) as perfor_grade_name from t_year_effect_info t where t.is_valid='0' and t.del_sign = '0' ");
		List<String> arryList = new ArrayList<String>();
		if (StringUtils.isNotBlank(erpNo)) {
			sqlBuilder.append(" AND erp_no= ? ");
			arryList.add(erpNo);
		}

		sqlBuilder.append(" order by rate_year_start desc");
		return this.findAllBySQL(TYearEffectInfo.class, sqlBuilder.toString(), null, false, arryList.toArray());
	}

	@Override
	public void findPageYearEffectByCondi(Page<TYearEffectInfo> page, TYearEffectInfo tYearEffectInfo) {
		String sql = "  select t.* " +
                " from t_year_effect_info t  where t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);

		ArrayList<Object> arrayList = new ArrayList<Object>();
        if (!StringUtil.isNullOrEmpty(tYearEffectInfo.getErpNo())) {
            sqlBuilder.append(" AND erp_no= ? ");
            arrayList.add(tYearEffectInfo.getErpNo());
        }

		sqlBuilder.append(" order by rate_year desc  ");
		this.findPageBySql(TYearEffectInfo.class, sqlBuilder.toString(), page, arrayList.toArray());
	}

	@Override
	public void addEducateInfo(TEducateInfo tEducateInfo) {
		String sql = "insert into t_educate_info (id,start_time,end_time,acqu_time,grad_school,school_type,major,educ_name,degree_name,is_cont_educ,is_employ_educ,is_highest_educ,erp_no,user_name,id_card_no,org_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},")
				.append("#{start_time,jdbcType=DATE},").append("#{end_time,jdbcType=DATE},")
				.append("#{acqu_time,jdbcType=VARCHAR},")
				.append("#{grad_school,jdbcType=VARCHAR},").append("#{school_type,jdbcType=VARCHAR},")
				.append("#{major,jdbcType=VARCHAR},").append("#{educ_name,jdbcType=VARCHAR},")
				.append("#{degree_name,jdbcType=VARCHAR},").append("#{is_cont_educ,jdbcType=VARCHAR},")
				.append("#{is_employ_educ,jdbcType=VARCHAR},").append("#{is_highest_educ,jdbcType=VARCHAR},")
				.append("#{erp_no,jdbcType=VARCHAR},").append("#{user_name,jdbcType=VARCHAR},")
				.append("#{id_card_no,jdbcType=VARCHAR},").append("#{org_id,jdbcType=VARCHAR},")
				.append("#{creater_id,jdbcType=VARCHAR},").append("#{creater_name,jdbcType=VARCHAR},")
				.append("#{create_time,jdbcType=DATE},").append("#{updater_id,jdbcType=VARCHAR},")
				.append("#{updater_name,jdbcType=VARCHAR},").append("#{update_time,jdbcType=DATE},")
				.append("#{del_sign,jdbcType=INTEGER},").append("#{is_valid,jdbcType=INTEGER},")
				.append("#{audit_state,jdbcType=INTEGER},").append("#{orignal_id,jdbcType=VARCHAR},")
				.append("#{flow_status,jdbcType=INTEGER},").append("#{business_type_id,jdbcType=VARCHAR},")
				.append("#{isc_user_id,jdbcType=VARCHAR},").append("#{primitive_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tEducateInfo.getId());
		params.put("start_time", tEducateInfo.getStartTime());
		params.put("end_time", tEducateInfo.getEndTime());
		params.put("acqu_time", tEducateInfo.getAcquTime());
		params.put("grad_school", tEducateInfo.getGradSchool());
		params.put("school_type", tEducateInfo.getSchoolType());
		params.put("major", tEducateInfo.getMajor());
		params.put("educ_name", tEducateInfo.getEducName());
		params.put("degree_name", tEducateInfo.getDegreeName());
		params.put("is_cont_educ", tEducateInfo.getIsContEduc());
		params.put("is_employ_educ", tEducateInfo.getIsEmployEduc());
		params.put("is_highest_educ", tEducateInfo.getIsHighestEduc());
		params.put("erp_no", tEducateInfo.getErpNo());
		params.put("user_name", tEducateInfo.getUserName());
		params.put("id_card_no", tEducateInfo.getIdCardNo());
		params.put("org_id", tEducateInfo.getOrgId());
		params.put("creater_id", tEducateInfo.getCreaterId());
		params.put("creater_name", tEducateInfo.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tEducateInfo.getUpdaterId());
		params.put("updater_name", tEducateInfo.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", tEducateInfo.getDelSign());
		params.put("is_valid", tEducateInfo.getIsValid());
		params.put("audit_state", tEducateInfo.getAuditState());
		params.put("orignal_id", tEducateInfo.getOrignalId());
		params.put("flow_status",tEducateInfo.getFlowStatus());
		params.put("business_type_id",tEducateInfo.getBusinessTypeId());
		params.put("isc_user_id",tEducateInfo.getIscUserId());
		params.put("primitive_id",tEducateInfo.getPrimitiveId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public void updateEducateInfo(TEducateInfo tEducateInfo) {
		String sql = "update t_educate_info set ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("is_highest_educ='1' ").append(" where erp_no=#{erp_no,jdbcType=VARCHAR}");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("erp_no", tEducateInfo.getErpNo());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public TEducateInfo getEducateInfoById(String id) {
		String sql = " select t.*,GET_DIC('CollegeCategory',school_type) as school_type_name, " +
				"   GET_DIC('PersonnelQualifications',educ_name) as educ_name_name, " +
				"   GET_DIC('AcademicDegree',degree_name) as degree_name_name  " +
				"   from t_educate_info t  " +
				"   where t.id= ? and t.del_sign = '0' ";
		return this.findUnique(TEducateInfo.class, sql, new Object[] { id });
	}

	@Override
	public List<TEducateInfo> getEducateInfoByErpNo(String erpNo,String isCountEduc) {
		String sql = " select t.*,GET_DIC('CollegeCategory',school_type) as school_type_name, " +
				"   GET_DIC('PersonnelQualifications',educ_name) as educ_name_name, " +
				"   GET_DIC('AcademicDegree',degree_name) as degree_name_name  " +
				"   from t_educate_info t where t.is_valid='0' and t.del_sign = '0' ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		List<String> arryList = new ArrayList<String>();
		if (StringUtils.isNotBlank(erpNo)) {
			sqlBuilder.append(" AND erp_no= ? ");
			arryList.add(erpNo);
		}

		if (StringUtils.isNotBlank(isCountEduc)) {
			sqlBuilder.append(" AND is_cont_educ= ? ");
			arryList.add(erpNo);
		}

		sqlBuilder.append(" order by end_time desc");
		return this.findAllBySQL(TEducateInfo.class, sqlBuilder.toString(), null, false, arryList.toArray());
	}

    @Override
    public void findPageEducateInfoByCondi(Page<TEducateInfo> page, TEducateInfo tEducateInfo) {
        String sql = "  select t.* " +
                " from t_educate_info t " +
                " where  t.is_valid='0' and t.del_sign = '0' AND (is_employ_educ = '0' or is_employ_educ is null or ((is_employ_educ = '1') and educ_name<40)) " ;
        StringBuilder sqlBuilder = new StringBuilder(sql);

        ArrayList<Object> arrayList = new ArrayList<Object>();
        if (!StringUtil.isNullOrEmpty(tEducateInfo.getErpNo())) {
            sqlBuilder.append(" AND erp_no= ? ");
            arrayList.add(tEducateInfo.getErpNo());
        }

		if (!StringUtil.isNullOrEmpty(tEducateInfo.getIsContEduc())) {
			sqlBuilder.append(" AND is_cont_educ= ? ");
			arrayList.add(tEducateInfo.getIsContEduc());
		}

        sqlBuilder.append(" order by acqu_time desc  ");
        this.findPageBySql(TEducateInfo.class, sqlBuilder.toString(), page, arrayList.toArray());
    }

    @Override
	public void addProTecInfo(TProTecInfo tProTecInfo) {
		String sql = "insert into t_pro_tec_info (id,erp_no,user_name,id_card_no,acqu_time,post_time,subj_name,subj_set,subj_level,audit_org,org_level,cert_no,org_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{erp_no,jdbcType=VARCHAR},")
				.append("#{user_name,jdbcType=VARCHAR},").append("#{id_card_no,jdbcType=VARCHAR},")
				.append("#{acqu_time,jdbcType=VARCHAR},").append("#{post_time,jdbcType=VARCHAR},").append("#{subj_name,jdbcType=VARCHAR},")
				.append("#{subj_set,jdbcType=VARCHAR},").append("#{subj_level,jdbcType=VARCHAR},")
				.append("#{audit_org,jdbcType=VARCHAR},").append("#{org_level,jdbcType=VARCHAR},")
				.append("#{cert_no,jdbcType=VARCHAR},").append("#{org_id,jdbcType=VARCHAR},")
				.append("#{creater_id,jdbcType=VARCHAR},").append("#{creater_name,jdbcType=VARCHAR},")
				.append("#{create_time,jdbcType=DATE},").append("#{updater_id,jdbcType=VARCHAR},")
				.append("#{updater_name,jdbcType=VARCHAR},").append("#{update_time,jdbcType=DATE},")
				.append("#{del_sign,jdbcType=INTEGER},").append("#{is_valid,jdbcType=INTEGER},")
				.append("#{audit_state,jdbcType=INTEGER},").append("#{orignal_id,jdbcType=VARCHAR},")
				.append("#{flow_status,jdbcType=INTEGER},").append("#{business_type_id,jdbcType=VARCHAR},")
				.append("#{isc_user_id,jdbcType=VARCHAR},").append("#{primitive_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tProTecInfo.getId());
		params.put("erp_no", tProTecInfo.getErpNo());
		params.put("user_name", tProTecInfo.getUserName());
		params.put("id_card_no", tProTecInfo.getIdCardNo());
		params.put("acqu_time", tProTecInfo.getAcquTime());
		params.put("post_time", tProTecInfo.getPostTime());
		params.put("subj_name", tProTecInfo.getSubjName());
		params.put("subj_set", tProTecInfo.getSubjSet());
		params.put("subj_level", tProTecInfo.getSubjLevel());
		params.put("audit_org", tProTecInfo.getAuditOrg());
		params.put("org_level", tProTecInfo.getOrgLevel());
		params.put("cert_no", tProTecInfo.getCertNo());
		params.put("org_id", tProTecInfo.getOrgId());
		params.put("creater_id", tProTecInfo.getCreaterId());
		params.put("creater_name", tProTecInfo.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tProTecInfo.getUpdaterId());
		params.put("updater_name", tProTecInfo.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", tProTecInfo.getDelSign());
		params.put("is_valid", tProTecInfo.getIsValid());
		params.put("audit_state", tProTecInfo.getAuditState());
		params.put("orignal_id", tProTecInfo.getOrignalId());
		params.put("flow_status",tProTecInfo.getFlowStatus());
		params.put("business_type_id",tProTecInfo.getBusinessTypeId());
		params.put("isc_user_id",tProTecInfo.getIscUserId());
		params.put("primitive_id",tProTecInfo.getPrimitiveId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public TProTecInfo getProTecInfoById(String id) {
		String sql = " select t.*,GET_DIC('ProTechnicalQualifications',subj_set) as subj_set_name, " +
				" GET_DIC('ProfessionalQualifications',subj_level) as subj_level_name, " +
				" GET_DIC('IdentificationUnitLevel',org_level) as org_level_name  " +
				"  from t_pro_tec_info t   where t.id= ? and t.del_sign = '0' " ;
		return this.findUnique(TProTecInfo.class, sql, new Object[] { id });
	}

	@Override
	public List<TProTecInfo> getProTecInfoByErpNo(String erpNo) {
		String sql = " select t.*,GET_DIC('ProTechnicalQualifications',subj_set) as subj_set_name, " +
				" GET_DIC('ProfessionalQualifications',subj_level) as subj_level_name, " +
				" GET_DIC('IdentificationUnitLevel',org_level) as org_level_name  " +
				"  from t_pro_tec_info t   where t.is_valid='0'  and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);
		List<String> arryList = new ArrayList<String>();
		if (StringUtils.isNotBlank(erpNo)) {
			sqlBuilder.append(" AND erp_no= ? ");
			arryList.add(erpNo);
		}

		sqlBuilder.append(" order by acqu_time desc");
		return this.findAllBySQL(TProTecInfo.class, sqlBuilder.toString(), null, false, arryList.toArray());
	}

    @Override
    public void findPageProTecInfoByCondi(Page<TProTecInfo> page, TProTecInfo tProTecInfo) {
        String sql = " select t.* " +
                "  from t_pro_tec_info t   where t.is_valid='0' and t.del_sign = '0' " ;
        StringBuilder sqlBuilder = new StringBuilder(sql);

        ArrayList<Object> arrayList = new ArrayList<Object>();
        if (!StringUtil.isNullOrEmpty(tProTecInfo.getErpNo())) {
            sqlBuilder.append(" AND erp_no= ? ");
            arrayList.add(tProTecInfo.getErpNo());
        }

        sqlBuilder.append(" order by acqu_time desc  ");
        this.findPageBySql(TProTecInfo.class, sqlBuilder.toString(), page, arrayList.toArray());
    }

    @Override
	public void addSkillLevelInfo(TSkillLevelInfo tSkillLevelInfo) {
		String sql = "insert into t_skill_level_info (id,erp_no,user_name,id_card_no,acqu_time,post_time,tech_type,qualifi_level,audit_org,org_level,cert_no,org_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{erp_no,jdbcType=VARCHAR},")
				.append("#{user_name,jdbcType=VARCHAR},").append("#{id_card_no,jdbcType=VARCHAR},")
				.append("#{acqu_time,jdbcType=VARCHAR},").append("#{post_time,jdbcType=VARCHAR},").append("#{tech_type,jdbcType=VARCHAR},")
				.append("#{qualifi_level,jdbcType=VARCHAR},").append("#{audit_org,jdbcType=VARCHAR},")
				.append("#{org_level,jdbcType=VARCHAR},").append("#{cert_no,jdbcType=VARCHAR},")
				.append("#{org_id,jdbcType=VARCHAR},").append("#{creater_id,jdbcType=VARCHAR},")
				.append("#{creater_name,jdbcType=VARCHAR},").append("#{create_time,jdbcType=DATE},")
				.append("#{updater_id,jdbcType=VARCHAR},").append("#{updater_name,jdbcType=VARCHAR},")
				.append("#{update_time,jdbcType=DATE},").append("#{del_sign,jdbcType=INTEGER},")
				.append("#{is_valid,jdbcType=INTEGER},").append("#{audit_state,jdbcType=INTEGER},")
				.append("#{orignal_id,jdbcType=VARCHAR},").append("#{flow_status,jdbcType=INTEGER},")
				.append("#{business_type_id,jdbcType=VARCHAR},").append("#{isc_user_id,jdbcType=VARCHAR},")
				.append("#{primitive_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tSkillLevelInfo.getId());
		params.put("erp_no", tSkillLevelInfo.getErpNo());
		params.put("user_name", tSkillLevelInfo.getUserName());
		params.put("id_card_no", tSkillLevelInfo.getIdCardNo());
		params.put("acqu_time", tSkillLevelInfo.getAcquTime());
		params.put("post_time", tSkillLevelInfo.getPostTime());
		params.put("tech_type", tSkillLevelInfo.getTechType());
		params.put("qualifi_level", tSkillLevelInfo.getQualifiLevel());
		params.put("audit_org", tSkillLevelInfo.getAuditOrg());
		params.put("org_level", tSkillLevelInfo.getOrgLevel());
		params.put("cert_no", tSkillLevelInfo.getCertNo());
		params.put("org_id", tSkillLevelInfo.getOrgId());
		params.put("creater_id", tSkillLevelInfo.getCreaterId());
		params.put("creater_name", tSkillLevelInfo.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tSkillLevelInfo.getUpdaterId());
		params.put("updater_name", tSkillLevelInfo.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", tSkillLevelInfo.getDelSign());
		params.put("is_valid", tSkillLevelInfo.getIsValid());
		params.put("audit_state", tSkillLevelInfo.getAuditState());
		params.put("orignal_id", tSkillLevelInfo.getOrignalId());
		params.put("flow_status",tSkillLevelInfo.getFlowStatus());
		params.put("business_type_id",tSkillLevelInfo.getBusinessTypeId());
		params.put("isc_user_id",tSkillLevelInfo.getIscUserId());
		params.put("primitive_id",tSkillLevelInfo.getPrimitiveId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public TSkillLevelInfo getTSkillLevelInfoById(String id) {
		String sql = "  select t.*,GET_DIC('SkillAppraisalWork',tech_type) as tech_type_name, " +
				" GET_DIC('QualificationLevel',qualifi_level) as qualifi_level_name, " +
				" GET_DIC('IdentificationUnitLevel',org_level) as org_level_name " +
				" from t_skill_level_info t where t.id = ?  and t.del_sign = '0' " ;
		return this.findUnique(TSkillLevelInfo.class, sql, new Object[] { id });
	}

	@Override
	public List<TSkillLevelInfo> getSkillLevelInfoByErpNo(String erpNo) {
		String sql = "  select t.*,GET_DIC('SkillAppraisalWork',tech_type) as tech_type_name, " +
				" GET_DIC('QualificationLevel',qualifi_level) as qualifi_level_name, " +
				" GET_DIC('IdentificationUnitLevel',org_level) as org_level_name " +
				" from t_skill_level_info t where t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);
		List<String> arryList = new ArrayList<String>();
		if (StringUtils.isNotBlank(erpNo)) {
			sqlBuilder.append(" AND erp_no= ? ");
			arryList.add(erpNo);
		}

		sqlBuilder.append(" order by acqu_time desc");
		return this.findAllBySQL(TSkillLevelInfo.class, sqlBuilder.toString(), null, false, arryList.toArray());
	}

    @Override
    public void findPageSkillLevelInfoByCondi(Page<TSkillLevelInfo> page, TSkillLevelInfo tSkillLevelInfo) {
        String sql = "  select t.* " +
                " from t_skill_level_info t where t.is_valid='0' and t.del_sign = '0' " ;
        StringBuilder sqlBuilder = new StringBuilder(sql);

        ArrayList<Object> arrayList = new ArrayList<Object>();
        if (!StringUtil.isNullOrEmpty(tSkillLevelInfo.getErpNo())) {
            sqlBuilder.append(" AND erp_no= ? ");
            arrayList.add(tSkillLevelInfo.getErpNo());
        }

        sqlBuilder.append(" order by acqu_time desc  ");
        this.findPageBySql(TSkillLevelInfo.class, sqlBuilder.toString(), page, arrayList.toArray());
    }

    @Override
	public void addExpertTitleInfo(TExpertTitleInfo tExpertTitleInfo) {
		String sql = "insert into t_expert_title_info (id,erp_no,user_name,id_card_no,major,acqu_time,post_time,level_name,type,emp_term_start,emp_term_end,emp_title,org_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{erp_no,jdbcType=VARCHAR},")
				.append("#{user_name,jdbcType=VARCHAR},").append("#{id_card_no,jdbcType=VARCHAR},")
				.append("#{major,jdbcType=VARCHAR},").append("#{acqu_time,jdbcType=VARCHAR},").append("#{post_time,jdbcType=VARCHAR},")
				.append("#{level_name,jdbcType=VARCHAR},").append("#{type,jdbcType=VARCHAR},")
				.append("#{emp_term_start,jdbcType=VARCHAR},").append("#{emp_term_end,jdbcType=VARCHAR},")
				.append("#{emp_title,jdbcType=VARCHAR},").append("#{org_id,jdbcType=VARCHAR},")
				.append("#{creater_id,jdbcType=VARCHAR},").append("#{creater_name,jdbcType=VARCHAR},")
				.append("#{create_time,jdbcType=DATE},").append("#{updater_id,jdbcType=VARCHAR},")
				.append("#{updater_name,jdbcType=VARCHAR},").append("#{update_time,jdbcType=DATE},")
				.append("#{del_sign,jdbcType=INTEGER},").append("#{is_valid,jdbcType=INTEGER},")
				.append("#{audit_state,jdbcType=INTEGER},").append("#{orignal_id,jdbcType=VARCHAR},")
				.append("#{flow_status,jdbcType=INTEGER},").append("#{business_type_id,jdbcType=VARCHAR},")
				.append("#{isc_user_id,jdbcType=VARCHAR},").append("#{primitive_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tExpertTitleInfo.getId());
		params.put("erp_no", tExpertTitleInfo.getErpNo());
		params.put("user_name", tExpertTitleInfo.getUserName());
		params.put("id_card_no", tExpertTitleInfo.getIdCardNo());
		params.put("major", tExpertTitleInfo.getMajor());
		params.put("acqu_time", tExpertTitleInfo.getAcquTime());
		params.put("post_time", tExpertTitleInfo.getPostTime());
		params.put("level_name", tExpertTitleInfo.getLevelName());
		params.put("type", tExpertTitleInfo.getType());
		params.put("emp_term_start", tExpertTitleInfo.getEmpTermStart());
		params.put("emp_term_end", tExpertTitleInfo.getEmpTermEnd());
		params.put("emp_title", tExpertTitleInfo.getEmpTitle());
		params.put("org_id", tExpertTitleInfo.getOrgId());
		params.put("creater_id", tExpertTitleInfo.getCreaterId());
		params.put("creater_name", tExpertTitleInfo.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tExpertTitleInfo.getUpdaterId());
		params.put("updater_name", tExpertTitleInfo.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", tExpertTitleInfo.getDelSign());
		params.put("is_valid", tExpertTitleInfo.getIsValid());
		params.put("audit_state", tExpertTitleInfo.getAuditState());
		params.put("orignal_id", tExpertTitleInfo.getOrignalId());
		params.put("flow_status",tExpertTitleInfo.getFlowStatus());
		params.put("business_type_id",tExpertTitleInfo.getBusinessTypeId());
		params.put("isc_user_id",tExpertTitleInfo.getIscUserId());
		params.put("primitive_id",tExpertTitleInfo.getPrimitiveId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public TExpertTitleInfo getExpertTitleInfoById(String id) {
		String sql = "  select t.*,GET_DIC('ProWorkTypes',major) as major_name, " +
				" GET_DIC('TalentTitle',emp_title) as emp_title_name, " +
				" GET_DIC('ExpertLevel',level_name) as level_name_name, " +
				" GET_DIC('ExpertCategory',type) as type_name  " +
				" from t_expert_title_info t where t.id = ?  and t.del_sign = '0' " ;
		return this.findUnique(TExpertTitleInfo.class, sql, new Object[] { id });
	}

	@Override
	public List<TExpertTitleInfo> getExpertTitleInfoByErpNo(String erpNo) {
		String sql = "  select t.*,GET_DIC('ProWorkTypes',major) as major_name, " +
				" GET_DIC('TalentTitle',emp_title) as emp_title_name, " +
				" GET_DIC('ExpertLevel',level_name) as level_name_name, " +
				" GET_DIC('ExpertCategory',type) as type_name  " +
				" from t_expert_title_info t where t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);
		List<String> arryList = new ArrayList<String>();
		if (StringUtils.isNotBlank(erpNo)) {
			sqlBuilder.append(" AND erp_no= ? ");
			arryList.add(erpNo);
		}

		sqlBuilder.append(" order by acqu_time desc");
		return this.findAllBySQL(TExpertTitleInfo.class, sqlBuilder.toString(), null, false, arryList.toArray());
	}

    @Override
    public void findPageExpertTitleInfoByCondi(Page<TExpertTitleInfo> page, TExpertTitleInfo tExpertTitleInfo) {
        String sql = "  select t.* " +
                " from t_expert_title_info t where  t.is_valid='0' and t.del_sign = '0' " ;
        StringBuilder sqlBuilder = new StringBuilder(sql);

        ArrayList<Object> arrayList = new ArrayList<Object>();
        if (!StringUtil.isNullOrEmpty(tExpertTitleInfo.getErpNo())) {
            sqlBuilder.append(" AND erp_no= ? ");
            arrayList.add(tExpertTitleInfo.getErpNo());
        }

        sqlBuilder.append(" order by acqu_time desc  ");
        this.findPageBySql(TExpertTitleInfo.class, sqlBuilder.toString(), page, arrayList.toArray());
    }

    @Override
	public void addAcadeAchiveInfo(TAcadeAchiveInfo tAcadeAchiveInfo) {
		String sql = "insert into t_acade_achive_info (id,pub_time,acad_type,acad_name,summary,pub_name,issn,periodic_no,page,publisher,level,part_count,org_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{pub_time,jdbcType=VARCHAR},")
				.append("#{acad_type,jdbcType=VARCHAR},").append("#{acad_name,jdbcType=VARCHAR},")
				.append("#{summary,jdbcType=VARCHAR},").append("#{pub_name,jdbcType=VARCHAR},")
				.append("#{issn,jdbcType=VARCHAR},").append("#{periodic_no,jdbcType=VARCHAR},")
				.append("#{page,jdbcType=VARCHAR},").append("#{publisher,jdbcType=VARCHAR},")
				.append("#{level,jdbcType=VARCHAR},").append("#{part_count,jdbcType=INTEGER},")
				.append("#{org_id,jdbcType=VARCHAR},").append("#{creater_id,jdbcType=VARCHAR},")
				.append("#{creater_name,jdbcType=VARCHAR},").append("#{create_time,jdbcType=DATE},")
				.append("#{updater_id,jdbcType=VARCHAR},").append("#{updater_name,jdbcType=VARCHAR},")
				.append("#{update_time,jdbcType=DATE},").append("#{del_sign,jdbcType=INTEGER},")
				.append("#{is_valid,jdbcType=INTEGER},").append("#{audit_state,jdbcType=INTEGER},")
				.append("#{orignal_id,jdbcType=VARCHAR},").append("#{flow_status,jdbcType=INTEGER},")
				.append("#{business_type_id,jdbcType=VARCHAR},").append("#{isc_user_id,jdbcType=VARCHAR},")
				.append("#{primitive_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tAcadeAchiveInfo.getId());
		params.put("pub_time", tAcadeAchiveInfo.getPubTime());
		params.put("acad_type", tAcadeAchiveInfo.getAcadType());
		params.put("acad_name", tAcadeAchiveInfo.getAcadName());
		params.put("summary", tAcadeAchiveInfo.getSummary());
		params.put("pub_name", tAcadeAchiveInfo.getPubName());
		params.put("issn", tAcadeAchiveInfo.getIssn());
		params.put("periodic_no", tAcadeAchiveInfo.getPeriodicNo());
		params.put("page", tAcadeAchiveInfo.getPage());
		params.put("publisher", tAcadeAchiveInfo.getPublisher());
		params.put("level", tAcadeAchiveInfo.getLevel());
		params.put("part_count", tAcadeAchiveInfo.getPartCount());
		params.put("org_id", tAcadeAchiveInfo.getOrgId());
		params.put("creater_id", tAcadeAchiveInfo.getCreaterId());
		params.put("creater_name", tAcadeAchiveInfo.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tAcadeAchiveInfo.getUpdaterId());
		params.put("updater_name", tAcadeAchiveInfo.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", 0);
		params.put("is_valid", tAcadeAchiveInfo.getIsValid());
		params.put("audit_state", tAcadeAchiveInfo.getAuditState());
		params.put("orignal_id", tAcadeAchiveInfo.getOrignalId());
		params.put("flow_status",tAcadeAchiveInfo.getFlowStatus());
		params.put("business_type_id",tAcadeAchiveInfo.getBusinessTypeId());
		params.put("isc_user_id",tAcadeAchiveInfo.getIscUserId());
		params.put("primitive_id",tAcadeAchiveInfo.getPrimitiveId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public TAcadeAchiveInfoVo getAcadeAchiveInfoById(String id) {
		String sql = " select t.*, " +
				" GET_DIC('XueshuchengguoType',t.acad_type) as acad_type_name, " +
				" GET_DIC('XueshuchengguoJb',t.level) as level_name " +
				" from t_acade_achive_info t " +
				" where t.id= ? and t.del_sign = '0' " ;
		return this.findUnique(TAcadeAchiveInfoVo.class, sql, new Object[] { id });
	}

	@Override
	public TAcadeAchiveInfo getAcadeAchiveInfoByIdForRecord(String id) {
		String sql = " select t.* " +
				" from t_acade_achive_info t " +
				" where t.id= ? and t.del_sign = '0' " ;
		return this.findUnique(TAcadeAchiveInfo.class, sql, new Object[] { id });
	}

	@Override
	public List<TAcadeAchiveInfoVo> getAcadeAchiveInfoByErpNo(String erpNo) {
		String sql = " select t.*,r.role,r.rank,r.erp_no, " +
				" GET_DIC('XueshuchengguoJs',r.role) as role_name, " +
				" GET_DIC('XueshuchengguoType',t.acad_type) as acad_type_name, " +
				" GET_DIC('XueshuchengguoJb',t.level) as level_name " +
				" from t_part_rank r , t_acade_achive_info t " +
				" where r.item_id=t.id and r.item_type='12'  and  t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);
		List<String> arryList = new ArrayList<String>();
		if (StringUtils.isNotBlank(erpNo)) {
			sqlBuilder.append(" AND r.erp_no= ? ");
			arryList.add(erpNo);
		}

		sqlBuilder.append(" order by pub_time desc");
		return this.findAllBySQL(TAcadeAchiveInfoVo.class, sqlBuilder.toString(), null, false, arryList.toArray());
	}



    @Override
    public void findPageAcadeAchiveInfoByCondi(Page<TAcadeAchiveInfoVo> page, TAcadeAchiveInfo tAcadeAchiveInfo) {
        String sql = " select t.*,r.role,r.rank,r.erp_no " +
                " from t_part_rank r , t_acade_achive_info t " +
                " where r.item_id=t.id and r.item_type='12' and  t.is_valid='0' and t.del_sign = '0' " ;
        StringBuilder sqlBuilder = new StringBuilder(sql);

        ArrayList<Object> arrayList = new ArrayList<Object>();

        StringBuilder erp_no_sb= new StringBuilder();

        if(!tAcadeAchiveInfo.gettPartRankList().isEmpty()){
            tAcadeAchiveInfo.gettPartRankList().forEach(tPartRank->{
                if(!StringUtil.isNullOrEmpty(tPartRank.getErpNo())){
                    erp_no_sb.append(",'").append(tPartRank.getErpNo()).append("'");
                }
            });
        }

        if(!StringUtil.isNullOrEmpty(erp_no_sb.toString())){
            sqlBuilder.append(" AND r.erp_no in ( ").append(erp_no_sb.toString().substring(1)).append(" )");
            //arrayList.add(erp_no_sb.toString().substring(1));
        }
        sqlBuilder.append(" order by pub_time desc ");
        this.findPageBySql(TAcadeAchiveInfoVo.class, sqlBuilder.toString(), page, null);
    }

    @Override
	public void addStandInfo(TStandInfo tStandInfo) {
		String sql = "insert into t_stand_info (id,issue_time,name,type,level,part_count,org_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{issue_time,jdbcType=VARCHAR},")
				.append("#{name,jdbcType=VARCHAR},").append("#{type,jdbcType=VARCHAR},")
				.append("#{level,jdbcType=VARCHAR},").append("#{part_count,jdbcType=INTEGER},")
				.append("#{org_id,jdbcType=VARCHAR},").append("#{creater_id,jdbcType=VARCHAR},")
				.append("#{creater_name,jdbcType=VARCHAR},").append("#{create_time,jdbcType=DATE},")
				.append("#{updater_id,jdbcType=VARCHAR},").append("#{updater_name,jdbcType=VARCHAR},")
				.append("#{update_time,jdbcType=DATE},").append("#{del_sign,jdbcType=INTEGER},")
				.append("#{is_valid,jdbcType=INTEGER},").append("#{audit_state,jdbcType=INTEGER},")
				.append("#{orignal_id,jdbcType=VARCHAR},").append("#{flow_status,jdbcType=INTEGER},")
				.append("#{business_type_id,jdbcType=VARCHAR},").append("#{isc_user_id,jdbcType=VARCHAR},")
				.append("#{primitive_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tStandInfo.getId());
		params.put("issue_time", tStandInfo.getIssueTime());
		params.put("name", tStandInfo.getName());
		params.put("type", tStandInfo.getType());
		params.put("level", tStandInfo.getLevel());
		params.put("part_count", tStandInfo.getPartCount());
		params.put("org_id", tStandInfo.getOrgId());
		params.put("creater_id", tStandInfo.getCreaterId());
		params.put("creater_name", tStandInfo.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tStandInfo.getUpdaterId());
		params.put("updater_name", tStandInfo.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", tStandInfo.getDelSign());
		params.put("is_valid", tStandInfo.getIsValid());
		params.put("audit_state", tStandInfo.getAuditState());
		params.put("orignal_id", tStandInfo.getOrignalId());
		params.put("flow_status",tStandInfo.getFlowStatus());
		params.put("business_type_id",tStandInfo.getBusinessTypeId());
		params.put("isc_user_id",tStandInfo.getIscUserId());
		params.put("primitive_id",tStandInfo.getPrimitiveId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public TStandInfoVo getStandInfoById(String id) {
		String sql = "  select t.*,  " +
				" GET_DIC('ZdbzType',t.type) as type_name,  " +
				" GET_DIC('JygexinQcJb',t.level) as level_name  " +
				" from t_stand_info t  " +
				" where t.id= ?  and t.del_sign = '0' " ;
		return this.findUnique(TStandInfoVo.class, sql, new Object[] { id });
	}

	@Override
	public TStandInfo getStandInfoByIdForRecord(String id) {
		String sql = "  select t.*  " +
				" from t_stand_info t  " +
				" where t.id= ?  and t.del_sign = '0' " ;
		return this.findUnique(TStandInfo.class, sql, new Object[] { id });
	}

	@Override
	public List<TStandInfoVo> getStandInfoByErpNo(String erpNo) {
		String sql = "  select t.*,r.role,r.rank,r.erp_no,  " +
				" GET_DIC('XueshuchengguoJs',r.role) as role_name,  " +
				" GET_DIC('ZdbzType',t.type) as type_name,  " +
				" GET_DIC('JygexinQcJb',t.level) as level_name  " +
				" from t_part_rank r , t_stand_info t  " +
				" where r.item_id=t.id and r.item_type='13' and  t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);
		List<String> arryList = new ArrayList<String>();
		if (StringUtils.isNotBlank(erpNo)) {
			sqlBuilder.append(" AND r.erp_no= ? ");
			arryList.add(erpNo);
		}

		sqlBuilder.append(" order by issue_time desc");
		return this.findAllBySQL(TStandInfoVo.class, sqlBuilder.toString(), null, false, arryList.toArray());
	}

    @Override
    public void findPageStandInfoByCondi(Page<TStandInfoVo> page, TStandInfo tStandInfo) {
		String sql = "  select t.*,r.role,r.rank,r.erp_no " +
				" from t_part_rank r , t_stand_info t  " +
				" where r.item_id=t.id and r.item_type='13' and  t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);

		ArrayList<Object> arrayList = new ArrayList<Object>();

		StringBuilder erp_no_sb= new StringBuilder();

		if(!tStandInfo.gettPartRankList().isEmpty()){
			tStandInfo.gettPartRankList().forEach(tPartRank->{
				if(!StringUtil.isNullOrEmpty(tPartRank.getErpNo())){
					erp_no_sb.append(",'").append(tPartRank.getErpNo()).append("'");
				}
			});
		}

		if(!StringUtil.isNullOrEmpty(erp_no_sb.toString())){
			sqlBuilder.append(" AND r.erp_no in ( ").append(erp_no_sb.toString().substring(1)).append(" )");
			//arrayList.add(erp_no_sb.toString().substring(1));
		}
		sqlBuilder.append(" order by issue_time desc ");
		this.findPageBySql(TStandInfoVo.class, sqlBuilder.toString(), page, null);
    }

    @Override
	public void addPatentInfo(TPatentInfo tPatentInfo) {
		String sql = "insert into t_patent_info (id,patent_name,patent_no,patent_type,apply_date,decl_date,inventor,part_count,org_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{patent_name,jdbcType=VARCHAR},")
				.append("#{patent_no,jdbcType=VARCHAR},").append("#{patent_type,jdbcType=VARCHAR},")
				.append("#{apply_date,jdbcType=VARCHAR},").append("#{decl_date,jdbcType=VARCHAR},")
				.append("#{inventor,jdbcType=VARCHAR},").append("#{part_count,jdbcType=INTEGER},")
				.append("#{org_id,jdbcType=VARCHAR},").append("#{creater_id,jdbcType=VARCHAR},")
				.append("#{creater_name,jdbcType=VARCHAR},").append("#{create_time,jdbcType=DATE},")
				.append("#{updater_id,jdbcType=VARCHAR},").append("#{updater_name,jdbcType=VARCHAR},")
				.append("#{update_time,jdbcType=DATE},").append("#{del_sign,jdbcType=INTEGER},")
				.append("#{is_valid,jdbcType=INTEGER},").append("#{audit_state,jdbcType=INTEGER},")
				.append("#{orignal_id,jdbcType=VARCHAR},").append("#{flow_status,jdbcType=INTEGER},")
				.append("#{business_type_id,jdbcType=VARCHAR},").append("#{isc_user_id,jdbcType=VARCHAR},")
				.append("#{primitive_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tPatentInfo.getId());
		params.put("patent_name", tPatentInfo.getPatentName());
		params.put("patent_no", tPatentInfo.getPatentNo());
		params.put("patent_type", tPatentInfo.getPatentType());
		params.put("apply_date", tPatentInfo.getApplyDate());
		params.put("decl_date", tPatentInfo.getDeclDate());
		params.put("inventor", tPatentInfo.getInventor());
		params.put("part_count", tPatentInfo.getPartCount());
		params.put("org_id", tPatentInfo.getOrgId());
		params.put("creater_id", tPatentInfo.getCreaterId());
		params.put("creater_name", tPatentInfo.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tPatentInfo.getUpdaterId());
		params.put("updater_name", tPatentInfo.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", tPatentInfo.getDelSign());
		params.put("is_valid", tPatentInfo.getIsValid());
		params.put("audit_state", tPatentInfo.getAuditState());
		params.put("orignal_id", tPatentInfo.getOrignalId());
		params.put("flow_status",tPatentInfo.getFlowStatus());
		params.put("business_type_id",tPatentInfo.getBusinessTypeId());
		params.put("isc_user_id",tPatentInfo.getIscUserId());
		params.put("primitive_id",tPatentInfo.getPrimitiveId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public TPatentInfoVo getPatentInfoById(String id) {
		String sql = "   select t.*," +
				" GET_DIC('PatentType',t.patent_type) as patent_type_name " +
				" from t_patent_info t  " +
				" where t.id = ?  and t.del_sign = '0' " ;
		return this.findUnique(TPatentInfoVo.class, sql, new Object[] { id });
	}

	@Override
	public TPatentInfo getPatentInfoByIdForRecord(String id) {
		String sql = "   select t.* " +
				" from t_patent_info t  " +
				" where t.id = ?  and t.del_sign = '0' " ;
		return this.findUnique(TPatentInfo.class, sql, new Object[] { id });
	}

	@Override
	public List<TPatentInfoVo> getPatentInfoByErpNo(String erpNo) {
		String sql = "   select t.*,r.role,r.rank,r.erp_no,  " +
				"  GET_DIC('XueshuchengguoJs',r.role) as role_name, " +
				" GET_DIC('PatentType',t.patent_type) as patent_type_name " +
				" from t_part_rank r , t_patent_info t  " +
				" where r.item_id=t.id and r.item_type='14'  and  t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);		List<String> arryList = new ArrayList<String>();
		if (StringUtils.isNotBlank(erpNo)) {
			sqlBuilder.append(" AND r.erp_no= ? ");
			arryList.add(erpNo);
		}

		sqlBuilder.append(" order by apply_date desc");
		return this.findAllBySQL(TPatentInfoVo.class, sqlBuilder.toString(), null, false, arryList.toArray());
	}

    @Override
    public void findPagePatentInfoByCondi(Page<TPatentInfoVo> page, TPatentInfo tPatentInfo) {
		String sql = "   select t.*,r.role,r.rank,r.erp_no " +
				" from t_part_rank r , t_patent_info t  " +
				" where r.item_id=t.id and r.item_type='14'  and  t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);

		ArrayList<Object> arrayList = new ArrayList<Object>();

		StringBuilder erp_no_sb= new StringBuilder();

		if(!tPatentInfo.gettPartRankList().isEmpty()){
			tPatentInfo.gettPartRankList().forEach(tPartRank->{
				if(!StringUtil.isNullOrEmpty(tPartRank.getErpNo())){
					erp_no_sb.append(",'").append(tPartRank.getErpNo()).append("'");
				}
			});
		}

		if(!StringUtil.isNullOrEmpty(erp_no_sb.toString())){
			sqlBuilder.append(" AND r.erp_no in ( ").append(erp_no_sb.toString().substring(1)).append(" )");
			//arrayList.add(erp_no_sb.toString().substring(1));
		}
		sqlBuilder.append(" order by apply_date desc ");
		this.findPageBySql(TPatentInfoVo.class, sqlBuilder.toString(), page, null);
    }

    @Override
	public void addTecInnovInfo(TTecInnovInfo tTecInnovInfo) {
		String sql = "insert into t_tec_innov_info (id,award_type,achi_name,sumary,award_name,award_date,award_org,award_level,award_grade,group_name,member_name,part_count,org_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{award_type,jdbcType=VARCHAR},").append("#{achi_name,jdbcType=VARCHAR},")
				.append("#{sumary,jdbcType=VARCHAR},").append("#{award_name,jdbcType=VARCHAR},")
				.append("#{award_date,jdbcType=VARCHAR},").append("#{award_org,jdbcType=VARCHAR},")
				.append("#{award_level,jdbcType=VARCHAR},").append("#{award_grade,jdbcType=VARCHAR},")
				.append("#{group_name,jdbcType=VARCHAR},").append("#{member_name,jdbcType=VARCHAR},")
				.append("#{part_count,jdbcType=INTEGER},").append("#{org_id,jdbcType=VARCHAR},")
				.append("#{creater_id,jdbcType=VARCHAR},").append("#{creater_name,jdbcType=VARCHAR},")
				.append("#{create_time,jdbcType=DATE},").append("#{updater_id,jdbcType=VARCHAR},")
				.append("#{updater_name,jdbcType=VARCHAR},").append("#{update_time,jdbcType=DATE},")
				.append("#{del_sign,jdbcType=INTEGER},").append("#{is_valid,jdbcType=INTEGER},")
				.append("#{audit_state,jdbcType=INTEGER},").append("#{orignal_id,jdbcType=VARCHAR},")
				.append("#{flow_status,jdbcType=INTEGER},").append("#{business_type_id,jdbcType=VARCHAR},")
				.append("#{isc_user_id,jdbcType=VARCHAR},").append("#{primitive_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tTecInnovInfo.getId());
		params.put("award_type", tTecInnovInfo.getAwardType());
		params.put("achi_name", tTecInnovInfo.getAchiName());
		params.put("sumary", tTecInnovInfo.getSumary());
		params.put("award_name", tTecInnovInfo.getAwardName());
		params.put("award_date", tTecInnovInfo.getAwardDate());
		params.put("award_org", tTecInnovInfo.getAwardOrg());
		params.put("award_level", tTecInnovInfo.getAwardLevel());
		params.put("award_grade", tTecInnovInfo.getAwardGrade());
		params.put("group_name", tTecInnovInfo.getGroupName());
		params.put("member_name", tTecInnovInfo.getMemberName());
		params.put("part_count", tTecInnovInfo.getPartCount());
		params.put("org_id", tTecInnovInfo.getOrgId());
		params.put("creater_id", tTecInnovInfo.getCreaterId());
		params.put("creater_name", tTecInnovInfo.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tTecInnovInfo.getUpdaterId());
		params.put("updater_name", tTecInnovInfo.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", tTecInnovInfo.getDelSign());
		params.put("is_valid", tTecInnovInfo.getIsValid());
		params.put("audit_state", tTecInnovInfo.getAuditState());
		params.put("orignal_id", tTecInnovInfo.getOrignalId());
		params.put("flow_status",tTecInnovInfo.getFlowStatus());
		params.put("business_type_id",tTecInnovInfo.getBusinessTypeId());
		params.put("isc_user_id",tTecInnovInfo.getIscUserId());
		params.put("primitive_id",tTecInnovInfo.getPrimitiveId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public TTecInnovInfoVo getTecInnovInfoById(String id) {
		String sql = "    select t.*," +
				" GET_DIC('JygexinQcJb',t.award_level) as award_level_name, " +
				" GET_DIC('JygexinQcDj',t.award_grade) as award_grade_name, " +
				" GET_DIC('jiyigexinType',t.award_type) as award_type_name " +
				" from t_tec_innov_info t  " +
				" where t.id = ?  and t.del_sign = '0' " ;
		return this.findUnique(TTecInnovInfoVo.class, sql, new Object[] { id });
	}

	@Override
	public TTecInnovInfo getTecInnovInfoByIdForRecord(String id) {
		String sql = "    select t.* " +
				" from t_tec_innov_info t  " +
				" where t.id = ?  and t.del_sign = '0' " ;
		return this.findUnique(TTecInnovInfo.class, sql, new Object[] { id });
	}

	@Override
	public List<TTecInnovInfoVo> getTecInnovInfoByErpNo(String erpNo) {
		String sql = "    select t.*,r.role,r.rank,r.erp_no, " +
				" GET_DIC('XueshuchengguoJs',r.role) as role_name, " +
				" GET_DIC('JygexinQcJb',t.award_level) as award_level_name, " +
				" GET_DIC('JygexinQcDj',t.award_grade) as award_grade_name, " +
				" GET_DIC('jiyigexinType',t.award_type) as award_type_name " +
				" from t_part_rank r , t_tec_innov_info t  " +
				" where r.item_id=t.id and r.item_type='15' and  t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);		List<String> arryList = new ArrayList<String>();
		if (StringUtils.isNotBlank(erpNo)) {
			sqlBuilder.append(" AND r.erp_no= ? ");
			arryList.add(erpNo);
		}

		sqlBuilder.append(" order by award_date desc");
		return this.findAllBySQL(TTecInnovInfoVo.class, sqlBuilder.toString(), null, false, arryList.toArray());
	}

    @Override
    public void findPageTecInnovInfoByCondi(Page<TTecInnovInfoVo> page, TTecInnovInfo tTecInnovInfo) {
		String sql = " select t.*,r.role,r.rank,r.erp_no " +
				" from t_part_rank r , t_tec_innov_info t  " +
				" where r.item_id=t.id and r.item_type='15' and  t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);

		ArrayList<Object> arrayList = new ArrayList<Object>();

		StringBuilder erp_no_sb= new StringBuilder();

		if(!tTecInnovInfo.gettPartRankList().isEmpty()){
			tTecInnovInfo.gettPartRankList().forEach(tPartRank->{
				if(!StringUtil.isNullOrEmpty(tPartRank.getErpNo())){
					erp_no_sb.append(",'").append(tPartRank.getErpNo()).append("'");
				}
			});
		}

		if(!StringUtil.isNullOrEmpty(erp_no_sb.toString())){
			sqlBuilder.append(" AND r.erp_no in ( ").append(erp_no_sb.toString().substring(1)).append(" )");
			//arrayList.add(erp_no_sb.toString().substring(1));
		}
		sqlBuilder.append(" order by award_date desc ");
		this.findPageBySql(TTecInnovInfoVo.class, sqlBuilder.toString(), page, null);
    }

    @Override
	public void addContestInfo(TContestInfo tContestInfo) {
		String sql = "insert into t_contest_info (id,erp_no,user_name,id_card_no,award_date,comp_name,host_org,award_name,award_level,comp_rank,get_title,org_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{erp_no,jdbcType=VARCHAR},")
				.append("#{user_name,jdbcType=VARCHAR},").append("#{id_card_no,jdbcType=VARCHAR},")
				.append("#{award_date,jdbcType=VARCHAR},").append("#{comp_name,jdbcType=VARCHAR},")
				.append("#{host_org,jdbcType=VARCHAR},").append("#{award_name,jdbcType=VARCHAR},")
				.append("#{award_level,jdbcType=VARCHAR},").append("#{comp_rank,jdbcType=VARCHAR},")
				.append("#{get_title,jdbcType=VARCHAR},").append("#{org_id,jdbcType=VARCHAR},")
				.append("#{creater_id,jdbcType=VARCHAR},").append("#{creater_name,jdbcType=VARCHAR},")
				.append("#{create_time,jdbcType=DATE},").append("#{updater_id,jdbcType=VARCHAR},")
				.append("#{updater_name,jdbcType=VARCHAR},").append("#{update_time,jdbcType=DATE},")
				.append("#{del_sign,jdbcType=INTEGER},").append("#{is_valid,jdbcType=INTEGER},")
				.append("#{audit_state,jdbcType=INTEGER},").append("#{orignal_id,jdbcType=VARCHAR},")
				.append("#{flow_status,jdbcType=INTEGER},").append("#{business_type_id,jdbcType=VARCHAR},")
				.append("#{isc_user_id,jdbcType=VARCHAR},").append("#{primitive_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tContestInfo.getId());
		params.put("erp_no", tContestInfo.getErpNo());
		params.put("user_name", tContestInfo.getUserName());
		params.put("id_card_no", tContestInfo.getIdCardNo());
		params.put("award_date", tContestInfo.getAwardDate());
		params.put("comp_name", tContestInfo.getCompName());
		params.put("host_org", tContestInfo.getHostOrg());
		params.put("award_name", tContestInfo.getAwardName());
		params.put("award_level", tContestInfo.getAwardLevel());
		params.put("comp_rank", tContestInfo.getCompRank());
		params.put("get_title", tContestInfo.getGetTitle());
		params.put("org_id", tContestInfo.getOrgId());
		params.put("creater_id", tContestInfo.getCreaterId());
		params.put("creater_name", tContestInfo.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tContestInfo.getUpdaterId());
		params.put("updater_name", tContestInfo.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", tContestInfo.getDelSign());
		params.put("is_valid", tContestInfo.getIsValid());
		params.put("audit_state", tContestInfo.getAuditState());
		params.put("orignal_id", tContestInfo.getOrignalId());
		params.put("flow_status",tContestInfo.getFlowStatus());
		params.put("business_type_id",tContestInfo.getBusinessTypeId());
		params.put("isc_user_id",tContestInfo.getIscUserId());
		params.put("primitive_id",tContestInfo.getPrimitiveId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public TContestInfo getContestInfoById(String id) {
		String sql = "  select t.*," +
				" GET_DIC('JygexinQcJb',award_level) as award_level_name,  " +
				" GET_DIC('JygexinQcDj',t.comp_rank) as comp_rank_name   " +
				" from t_contest_info t where t.id= ?  and t.del_sign = '0' " ;
		return this.findUnique(TContestInfo.class, sql, new Object[] { id });
	}

	@Override
	public List<TContestInfo> getContestInfoByErpNo(String erpNo) {
		String sql = "  select t.*," +
				" GET_DIC('JygexinQcJb',award_level) as award_level_name,  " +
				" GET_DIC('JygexinQcDj',t.comp_rank) as comp_rank_name   " +
				" from t_contest_info t where t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);
		List<String> arryList = new ArrayList<String>();
		if (StringUtils.isNotBlank(erpNo)) {
			sqlBuilder.append(" AND erp_no= ? ");
			arryList.add(erpNo);
		}

		sqlBuilder.append(" order by award_date desc");
		return this.findAllBySQL(TContestInfo.class, sqlBuilder.toString(), null, false, arryList.toArray());
	}

    @Override
    public void findPageContestInfoByCondi(Page<TContestInfo> page, TContestInfo tContestInfo) {
		String sql = "  select t.* " +
				" from t_contest_info t where t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);

		ArrayList<Object> arrayList = new ArrayList<Object>();
		if (!StringUtil.isNullOrEmpty(tContestInfo.getErpNo())) {
			sqlBuilder.append(" AND erp_no= ? ");
			arrayList.add(tContestInfo.getErpNo());
		}

		sqlBuilder.append(" order by award_date desc  ");
		this.findPageBySql(TContestInfo.class, sqlBuilder.toString(), page, arrayList.toArray());
    }

    @Override
	public void addTecManInnov(TTecManInnov tTecManInnov) {
		String sql = "insert into t_tec_man_innov (id,achi_name,achi_type,summary,award_name,award_date,award_org,award_level,award_grade,group_name,member_name,part_count,org_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{achi_name,jdbcType=VARCHAR},")
				.append("#{achi_type,jdbcType=VARCHAR},").append("#{summary,jdbcType=VARCHAR},")
				.append("#{award_name,jdbcType=VARCHAR},").append("#{award_date,jdbcType=VARCHAR},")
				.append("#{award_org,jdbcType=VARCHAR},").append("#{award_level,jdbcType=VARCHAR},")
				.append("#{award_grade,jdbcType=VARCHAR},").append("#{group_name,jdbcType=VARCHAR},")
				.append("#{member_name,jdbcType=VARCHAR},").append("#{part_count,jdbcType=INTEGER},").append("#{org_id,jdbcType=VARCHAR},")
				.append("#{creater_id,jdbcType=VARCHAR},").append("#{creater_name,jdbcType=VARCHAR},")
				.append("#{create_time,jdbcType=DATE},").append("#{updater_id,jdbcType=VARCHAR},")
				.append("#{updater_name,jdbcType=VARCHAR},").append("#{update_time,jdbcType=DATE},")
				.append("#{del_sign,jdbcType=INTEGER},").append("#{is_valid,jdbcType=INTEGER},")
				.append("#{audit_state,jdbcType=INTEGER},").append("#{orignal_id,jdbcType=VARCHAR},")
				.append("#{flow_status,jdbcType=INTEGER},").append("#{business_type_id,jdbcType=VARCHAR},")
				.append("#{isc_user_id,jdbcType=VARCHAR},").append("#{primitive_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tTecManInnov.getId());
		params.put("achi_name", tTecManInnov.getAchiName());
		params.put("achi_type", tTecManInnov.getAchiType());
		params.put("summary", tTecManInnov.getSummary());
		params.put("award_name", tTecManInnov.getAwardName());
		params.put("award_date", tTecManInnov.getAwardDate());
		params.put("award_org", tTecManInnov.getAwardOrg());
		params.put("award_level", tTecManInnov.getAwardLevel());
		params.put("award_grade", tTecManInnov.getAwardGrade());
		params.put("group_name", tTecManInnov.getGroupName());
		params.put("member_name", tTecManInnov.getMemberName());
		params.put("part_count", tTecManInnov.getPartCount());
		params.put("org_id", tTecManInnov.getOrgId());
		params.put("creater_id", tTecManInnov.getCreaterId());
		params.put("creater_name", tTecManInnov.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tTecManInnov.getUpdaterId());
		params.put("updater_name", tTecManInnov.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", tTecManInnov.getDelSign());
		params.put("is_valid", tTecManInnov.getIsValid());
		params.put("audit_state", tTecManInnov.getAuditState());
		params.put("orignal_id", tTecManInnov.getOrignalId());
		params.put("flow_status",tTecManInnov.getFlowStatus());
		params.put("business_type_id",tTecManInnov.getBusinessTypeId());
		params.put("isc_user_id",tTecManInnov.getIscUserId());
		params.put("primitive_id",tTecManInnov.getPrimitiveId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public TTecManInnovVo getTecManInnovById(String id) {
		String sql = "  select t.*," +
				"  GET_DIC('JygexinQcJb',t.award_level) as award_level_name, " +
				"  GET_DIC('JygexinQcDj',t.award_grade) as award_grade_name, " +
				"  GET_DIC('KjglAchiveType',t.achi_type) as achi_type_name " +
				" from t_tec_man_innov t  " +
				" where t.id= ? and t.del_sign = '0' " ;
		return this.findUnique(TTecManInnovVo.class, sql, new Object[] { id });
	}

	@Override
	public TTecManInnov getTecManInnovByIdForRecord(String id) {
		String sql = "  select t.* " +
				" from t_tec_man_innov t  " +
				" where t.id= ? and t.del_sign = '0' " ;
		return this.findUnique(TTecManInnov.class, sql, new Object[] { id });
	}

	@Override
	public List<TTecManInnovVo> getTecManInnovByErpNo(String erpNo) {
		String sql = "  select t.*,r.role,r.rank,r.erp_no, " +
				"  GET_DIC('XueshuchengguoJs',r.role) as role_name, " +
				"  GET_DIC('KjglAchiveType',t.achi_type) as achi_type_name, " +
				"  GET_DIC('JygexinQcJb',t.award_level) as award_level_name, " +
				"  GET_DIC('JygexinQcDj',t.award_grade) as award_grade_name " +
				" from t_part_rank r , t_tec_man_innov t  " +
				" where r.item_id=t.id and r.item_type='16' and  t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);
		List<String> arryList = new ArrayList<String>();
		if (StringUtils.isNotBlank(erpNo)) {
			sqlBuilder.append(" AND r.erp_no= ? ");
			arryList.add(erpNo);
		}

		sqlBuilder.append(" order by award_date desc");
		return this.findAllBySQL(TTecManInnovVo.class, sqlBuilder.toString(), null, false, arryList.toArray());
	}

    @Override
    public void findPageTecManInnovByCondi(Page<TTecManInnovVo> page, TTecManInnov tTecManInnov) {
		String sql = "  select t.*,r.role,r.rank,r.erp_no " +
				" from t_part_rank r , t_tec_man_innov t  " +
				" where r.item_id=t.id and r.item_type='16' and  t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);

		ArrayList<Object> arrayList = new ArrayList<Object>();

		StringBuilder erp_no_sb= new StringBuilder();

		if(!tTecManInnov.gettPartRankList().isEmpty()){
			tTecManInnov.gettPartRankList().forEach(tPartRank->{
				if(!StringUtil.isNullOrEmpty(tPartRank.getErpNo())){
					erp_no_sb.append(",'").append(tPartRank.getErpNo()).append("'");
				}
			});
		}

		if(!StringUtil.isNullOrEmpty(erp_no_sb.toString())){
			sqlBuilder.append(" AND r.erp_no in ( ").append(erp_no_sb.toString().substring(1)).append(" )");
			//arrayList.add(erp_no_sb.toString().substring(1));
		}
		sqlBuilder.append(" order by award_date desc ");
		this.findPageBySql(TTecManInnovVo.class, sqlBuilder.toString(), page, null);
    }

    @Override
	public void addHonorInfo(THonorInfo tHonorInfo) {
		String sql = "insert into t_honor_info (id,erp_no,user_name,id_card_no,acqu_time,honor_title,award_org,honor_level,honor_type,org_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{erp_no,jdbcType=VARCHAR},")
				.append("#{user_name,jdbcType=VARCHAR},").append("#{id_card_no,jdbcType=VARCHAR},")
				.append("#{acqu_time,jdbcType=VARCHAR},").append("#{honor_title,jdbcType=VARCHAR},")
				.append("#{award_org,jdbcType=VARCHAR},").append("#{honor_level,jdbcType=VARCHAR},")
				.append("#{honor_type,jdbcType=VARCHAR},").append("#{org_id,jdbcType=VARCHAR},")
				.append("#{creater_id,jdbcType=VARCHAR},").append("#{creater_name,jdbcType=VARCHAR},")
				.append("#{create_time,jdbcType=DATE},").append("#{updater_id,jdbcType=VARCHAR},")
				.append("#{updater_name,jdbcType=VARCHAR},").append("#{update_time,jdbcType=DATE},")
				.append("#{del_sign,jdbcType=INTEGER},").append("#{is_valid,jdbcType=INTEGER},")
				.append("#{audit_state,jdbcType=INTEGER},").append("#{orignal_id,jdbcType=VARCHAR},")
				.append("#{flow_status,jdbcType=INTEGER},").append("#{business_type_id,jdbcType=VARCHAR},")
				.append("#{isc_user_id,jdbcType=VARCHAR},").append("#{primitive_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tHonorInfo.getId());
		params.put("erp_no", tHonorInfo.getErpNo());
		params.put("user_name", tHonorInfo.getUserName());
		params.put("id_card_no", tHonorInfo.getIdCardNo());
		params.put("acqu_time", tHonorInfo.getAcquTime());
		params.put("honor_title", tHonorInfo.getHonorTitle());
		params.put("award_org", tHonorInfo.getAwardOrg());
		params.put("honor_level", tHonorInfo.getHonorLevel());
		params.put("honor_type", tHonorInfo.getHonorType());
		params.put("org_id", tHonorInfo.getOrgId());
		params.put("creater_id", tHonorInfo.getCreaterId());
		params.put("creater_name", tHonorInfo.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tHonorInfo.getUpdaterId());
		params.put("updater_name", tHonorInfo.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", tHonorInfo.getDelSign());
		params.put("is_valid", tHonorInfo.getIsValid());
		params.put("audit_state", tHonorInfo.getAuditState());
		params.put("orignal_id", tHonorInfo.getOrignalId());
		params.put("flow_status",tHonorInfo.getFlowStatus());
		params.put("business_type_id",tHonorInfo.getBusinessTypeId());
		params.put("isc_user_id",tHonorInfo.getIscUserId());
		params.put("primitive_id",tHonorInfo.getPrimitiveId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public THonorInfo getHonorInfoById(String id) {
		String sql = " select t.*, " +
				"  GET_DIC('JygexinQcJb',honor_level) as honor_level_name,  " +
				" GET_DIC('RuYuLeiBie',t.honor_type) as honor_type_name   " +
				" from t_honor_info t where t.id = ? and t.del_sign = '0' " ;
		return this.findUnique(THonorInfo.class, sql, new Object[] { id });
	}

	@Override
	public List<THonorInfo> getHonnorInfoByErpNo(String erpNo) {
		String sql = " select t.*, " +
				"  GET_DIC('JygexinQcJb',honor_level) as honor_level_name,  " +
				" GET_DIC('RuYuLeiBie',t.honor_type) as honor_type_name   " +
				" from t_honor_info t where t.is_valid='0'  and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);
		List<String> arryList = new ArrayList<String>();
		if (StringUtils.isNotBlank(erpNo)) {
			sqlBuilder.append(" AND erp_no= ? ");
			arryList.add(erpNo);
		}

		sqlBuilder.append(" order by acqu_time desc");
		return this.findAllBySQL(THonorInfo.class, sqlBuilder.toString(), null, false, arryList.toArray());
	}

    @Override
    public void findPageHonorInfoByCondi(Page<THonorInfo> page, THonorInfo tHonorInfo) {

		String sql = " select t.* " +
				" from t_honor_info t where t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);

		ArrayList<Object> arrayList = new ArrayList<Object>();
		if (!StringUtil.isNullOrEmpty(tHonorInfo.getErpNo())) {
			sqlBuilder.append(" AND erp_no= ? ");
			arrayList.add(tHonorInfo.getErpNo());
		}

		sqlBuilder.append(" order by acqu_time desc  ");
		this.findPageBySql(THonorInfo.class, sqlBuilder.toString(), page, arrayList.toArray());
    }

    @Override
	public void addWorkExpInfo(TWorkExpInfo tWorkExpInfo) {
		String sql = "insert into t_work_exp_info (id,erp_no,user_name,id_card_no,start_date,end_date,company,dept,post,rank,job_content,post_type,org_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{erp_no,jdbcType=VARCHAR},")
				.append("#{user_name,jdbcType=VARCHAR},").append("#{id_card_no,jdbcType=VARCHAR},")
				.append("#{start_date,jdbcType=VARCHAR},").append("#{end_date,jdbcType=VARCHAR},")
				.append("#{company,jdbcType=VARCHAR},").append("#{dept,jdbcType=VARCHAR},")
				.append("#{post,jdbcType=VARCHAR},").append("#{rank,jdbcType=VARCHAR},")
				.append("#{job_content,jdbcType=VARCHAR},").append("#{post_type,jdbcType=VARCHAR},")
				.append("#{org_id,jdbcType=VARCHAR},").append("#{creater_id,jdbcType=VARCHAR},")
				.append("#{creater_name,jdbcType=VARCHAR},").append("#{create_time,jdbcType=DATE},")
				.append("#{updater_id,jdbcType=VARCHAR},").append("#{updater_name,jdbcType=VARCHAR},")
				.append("#{update_time,jdbcType=DATE},").append("#{del_sign,jdbcType=INTEGER},")
				.append("#{is_valid,jdbcType=INTEGER},").append("#{audit_state,jdbcType=INTEGER},")
				.append("#{orignal_id,jdbcType=VARCHAR},").append("#{flow_status,jdbcType=INTEGER},")
				.append("#{business_type_id,jdbcType=VARCHAR},").append("#{isc_user_id,jdbcType=VARCHAR},")
				.append("#{primitive_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tWorkExpInfo.getId());
		params.put("erp_no", tWorkExpInfo.getErpNo());
		params.put("user_name", tWorkExpInfo.getUserName());
		params.put("id_card_no", tWorkExpInfo.getIdCardNo());
		params.put("start_date", tWorkExpInfo.getStartDate());
		params.put("end_date", tWorkExpInfo.getEndDate());
		params.put("company", tWorkExpInfo.getCompany());
		params.put("dept", tWorkExpInfo.getDept());
		params.put("post", tWorkExpInfo.getPost());
		params.put("rank", tWorkExpInfo.getRank());
		params.put("job_content", tWorkExpInfo.getJobContent());
		params.put("post_type", tWorkExpInfo.getPostType());
		params.put("org_id", tWorkExpInfo.getOrgId());
		params.put("creater_id", tWorkExpInfo.getCreaterId());
		params.put("creater_name", tWorkExpInfo.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tWorkExpInfo.getUpdaterId());
		params.put("updater_name", tWorkExpInfo.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", tWorkExpInfo.getDelSign());
		params.put("is_valid", tWorkExpInfo.getIsValid());
		params.put("audit_state", tWorkExpInfo.getAuditState());
		params.put("orignal_id", tWorkExpInfo.getOrignalId());
		params.put("flow_status",tWorkExpInfo.getFlowStatus());
		params.put("business_type_id",tWorkExpInfo.getBusinessTypeId());
		params.put("isc_user_id",tWorkExpInfo.getIscUserId());
		params.put("primitive_id",tWorkExpInfo.getPrimitiveId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public TWorkExpInfo getWorkExpInfoById(String id) {
		String sql = "  select t.*," +
				"  GET_DIC('PostCategory',post_type) as post_type_name,  " +
				" GET_DIC('DutyLevel',rank) as rank_name   " +
				" from t_work_exp_info t where t.id = ? and t.del_sign = '0' ";
		return this.findUnique(TWorkExpInfo.class, sql, new Object[] { id });
	}

	@Override
	public List<TWorkExpInfo> getWorkExpInfoByErpNo(String erpNo) {
		String sql = "  select t.*," +
				"  GET_DIC('PostCategory',post_type) as post_type_name,  " +
				" GET_DIC('DutyLevel',rank) as rank_name   " +
				" from t_work_exp_info t where  t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);
		List<String> arryList = new ArrayList<String>();
		if (StringUtils.isNotBlank(erpNo)) {
			sqlBuilder.append(" AND erp_no= ? ");
			arryList.add(erpNo);
		}

		sqlBuilder.append(" order by start_date desc");
		return this.findAllBySQL(TWorkExpInfo.class, sqlBuilder.toString(), null, false, arryList.toArray());
	}

    @Override
    public void findPageWorkExpInfoByCondi(Page<TWorkExpInfo> page, TWorkExpInfo tWorkExpInfo) {
		String sql = "  select t.* " +
				" from t_work_exp_info t where t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);

		ArrayList<Object> arrayList = new ArrayList<Object>();
		if (!StringUtil.isNullOrEmpty(tWorkExpInfo.getErpNo())) {
			sqlBuilder.append(" AND erp_no= ? ");
			arrayList.add(tWorkExpInfo.getErpNo());
		}

		sqlBuilder.append(" order by start_date desc  ");
		this.findPageBySql(TWorkExpInfo.class, sqlBuilder.toString(), page, arrayList.toArray());
    }

    @Override
	public void addContiStudyInfo(TContiStudyInfo tContiStudyInfo) {
		String sql = "insert into t_conti_study_info (id,start_time,end_time,major,study_place,certifier,study_length,erp_no,user_name,id_card_no,type,level,org_id,creater_id,creater_name," +
				"create_time," +
				"updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{start_time,jdbcType=VARCHAR},")
				.append("#{end_time,jdbcType=VARCHAR},").append("#{major,jdbcType=VARCHAR},")
				.append("#{study_place,jdbcType=VARCHAR},").append("#{certifier,jdbcType=VARCHAR},").append("#{study_length,jdbcType=INTEGER},")
				.append("#{erp_no,jdbcType=VARCHAR},").append("#{user_name,jdbcType=VARCHAR},")
				.append("#{id_card_no,jdbcType=VARCHAR},").append("#{type,jdbcType=VARCHAR},")
				.append("#{level,jdbcType=VARCHAR},").append("#{org_id,jdbcType=VARCHAR},")
				.append("#{creater_id,jdbcType=VARCHAR},").append("#{creater_name,jdbcType=VARCHAR},")
				.append("#{create_time,jdbcType=DATE},").append("#{updater_id,jdbcType=VARCHAR},")
				.append("#{updater_name,jdbcType=VARCHAR},").append("#{update_time,jdbcType=DATE},")
				.append("#{del_sign,jdbcType=INTEGER},").append("#{is_valid,jdbcType=INTEGER},")
				.append("#{audit_state,jdbcType=INTEGER},").append("#{orignal_id,jdbcType=VARCHAR},")
				.append("#{flow_status,jdbcType=INTEGER},").append("#{business_type_id,jdbcType=VARCHAR},")
				.append("#{isc_user_id,jdbcType=VARCHAR},").append("#{primitive_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tContiStudyInfo.getId());
		params.put("start_time", tContiStudyInfo.getStartTime());
		params.put("end_time", tContiStudyInfo.getEndTime());
		params.put("major", tContiStudyInfo.getMajor());
		params.put("study_place", tContiStudyInfo.getStudyPlace());
		params.put("certifier", tContiStudyInfo.getCertifier());
		params.put("study_length", tContiStudyInfo.getStudyLength());
		params.put("erp_no", tContiStudyInfo.getErpNo());
		params.put("user_name", tContiStudyInfo.getUserName());
		params.put("id_card_no", tContiStudyInfo.getIdCardNo());
		params.put("type", tContiStudyInfo.getType());
		params.put("level", tContiStudyInfo.getLevel());
		params.put("org_id", tContiStudyInfo.getOrgId());
		params.put("creater_id", tContiStudyInfo.getCreaterId());
		params.put("creater_name", tContiStudyInfo.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tContiStudyInfo.getUpdaterId());
		params.put("updater_name", tContiStudyInfo.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", tContiStudyInfo.getDelSign());
		params.put("is_valid", tContiStudyInfo.getIsValid());
		params.put("audit_state", tContiStudyInfo.getAuditState());
		params.put("orignal_id", tContiStudyInfo.getOrignalId());
		params.put("flow_status",tContiStudyInfo.getFlowStatus());
		params.put("business_type_id",tContiStudyInfo.getBusinessTypeId());
		params.put("isc_user_id",tContiStudyInfo.getIscUserId());
		params.put("primitive_id",tContiStudyInfo.getPrimitiveId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public TContiStudyInfo getContiStudyInfoById(String id) {
		String sql = "   select t.*, " +
				" GET_DIC('PeixunshoukeType',type) as type_name, GET_DIC('PeixunshoukeLevel',level) as level_name " +
				" from t_conti_study_info t where t.id = ? and t.del_sign = '0' " ;
		return this.findUnique(TContiStudyInfo.class, sql, new Object[] { id });
	}

	@Override
	public List<TContiStudyInfo> getContiStudyInfoByErpNo(String erpNo) {
		String sql = "   select t.*, " +
				" GET_DIC('PeixunshoukeType',type) as type_name, GET_DIC('PeixunshoukeLevel',level) as level_name  " +
				" from t_conti_study_info t where t.is_valid='0'  and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);
		List<String> arryList = new ArrayList<String>();
		if (StringUtils.isNotBlank(erpNo)) {
			sqlBuilder.append(" AND erp_no= ? ");
			arryList.add(erpNo);
		}

		sqlBuilder.append(" order by start_time desc");
		return this.findAllBySQL(TContiStudyInfo.class, sqlBuilder.toString(), null, false, arryList.toArray());
	}

    @Override
    public void findPageContiStudyInfoByCondi(Page<TContiStudyInfo> page, TContiStudyInfo tContiStudyInfo) {
		String sql = "   select t.* " +
				" from t_conti_study_info t where t.is_valid='0'  and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);

		ArrayList<Object> arrayList = new ArrayList<Object>();
		if (!StringUtil.isNullOrEmpty(tContiStudyInfo.getErpNo())) {
			sqlBuilder.append(" AND erp_no= ? ");
			arrayList.add(tContiStudyInfo.getErpNo());
		}

		sqlBuilder.append(" order by start_time desc  ");
		this.findPageBySql(TContiStudyInfo.class, sqlBuilder.toString(), page, arrayList.toArray());

    }

    //添加师带徒信息
    @Override
	public void addSdtTutorPrentInfo(TSdtTutorPrentInfo tSdtTutorPrentInfo) {
		String sql = "insert into t_sdt_tutor_prent_info (id,start_date,end_date,tutor_name,prent_name,teach_summary,erp_no,id_card_no,org_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{start_date,jdbcType=VARCHAR},")
				.append("#{end_date,jdbcType=VARCHAR},").append("#{tutor_name,jdbcType=VARCHAR},")
				.append("#{prent_name,jdbcType=VARCHAR},").append("#{teach_summary,jdbcType=VARCHAR},")
				.append("#{erp_no,jdbcType=VARCHAR},").append("#{id_card_no,jdbcType=VARCHAR},")
				.append("#{org_id,jdbcType=VARCHAR},").append("#{creater_id,jdbcType=VARCHAR},")
				.append("#{creater_name,jdbcType=VARCHAR},").append("#{create_time,jdbcType=DATE},")
				.append("#{updater_id,jdbcType=VARCHAR},").append("#{updater_name,jdbcType=VARCHAR},")
				.append("#{update_time,jdbcType=DATE},").append("#{del_sign,jdbcType=INTEGER},")
				.append("#{is_valid,jdbcType=INTEGER},").append("#{audit_state,jdbcType=INTEGER},")
				.append("#{orignal_id,jdbcType=VARCHAR},").append("#{flow_status,jdbcType=INTEGER},")
				.append("#{business_type_id,jdbcType=VARCHAR},").append("#{isc_user_id,jdbcType=VARCHAR},")
				.append("#{primitive_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tSdtTutorPrentInfo.getId());
		params.put("start_date", tSdtTutorPrentInfo.getStartDate());
		params.put("end_date", tSdtTutorPrentInfo.getEndDate());
		params.put("tutor_name", tSdtTutorPrentInfo.getTutorName());
		params.put("prent_name", tSdtTutorPrentInfo.getPrentName());
		params.put("teach_summary", tSdtTutorPrentInfo.getTeachSummary());
		params.put("erp_no", tSdtTutorPrentInfo.getErpNo());
		params.put("id_card_no", tSdtTutorPrentInfo.getIdCardNo());
		params.put("org_id", tSdtTutorPrentInfo.getOrgId());
		params.put("creater_id", tSdtTutorPrentInfo.getCreaterId());
		params.put("creater_name", tSdtTutorPrentInfo.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tSdtTutorPrentInfo.getUpdaterId());
		params.put("updater_name", tSdtTutorPrentInfo.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", tSdtTutorPrentInfo.getDelSign());
		params.put("is_valid", tSdtTutorPrentInfo.getIsValid());
		params.put("audit_state", tSdtTutorPrentInfo.getAuditState());
		params.put("orignal_id", tSdtTutorPrentInfo.getOrignalId());
		params.put("flow_status",tSdtTutorPrentInfo.getFlowStatus());
		params.put("business_type_id",tSdtTutorPrentInfo.getBusinessTypeId());
		params.put("isc_user_id",tSdtTutorPrentInfo.getIscUserId());
		params.put("primitive_id",tSdtTutorPrentInfo.getPrimitiveId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	//徒弟信息添加
	@Override
	public void addSdtPrentInfo(TSdtPrentInfo tSdtPrentInfo) {
		String sql = "insert into t_sdt_prent_info (id,sdt_id,erp_no,user_name,id_card_no,win_info,award_name,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,orignal_id,flow_status,business_type_id,isc_user_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{sdt_id,jdbcType=VARCHAR},")
				.append("#{erp_no,jdbcType=VARCHAR},").append("#{user_name,jdbcType=VARCHAR},")
				.append("#{id_card_no,jdbcType=VARCHAR},").append("#{win_info,jdbcType=VARCHAR},")
				.append("#{award_name,jdbcType=VARCHAR},").append("#{creater_id,jdbcType=VARCHAR},")
				.append("#{creater_name,jdbcType=VARCHAR},").append("#{create_time,jdbcType=DATE},")
				.append("#{updater_id,jdbcType=VARCHAR},").append("#{updater_name,jdbcType=VARCHAR},")
				.append("#{update_time,jdbcType=DATE},").append("#{del_sign,jdbcType=INTEGER},")
				.append("#{orignal_id,jdbcType=VARCHAR},").append("#{flow_status,jdbcType=INTEGER},")
				.append("#{business_type_id,jdbcType=VARCHAR},").append("#{isc_user_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tSdtPrentInfo.getId());
		params.put("sdt_id", tSdtPrentInfo.getSdtId());
		params.put("erp_no", tSdtPrentInfo.getErpNo());
		params.put("user_name", tSdtPrentInfo.getUserName());
		params.put("id_card_no", tSdtPrentInfo.getIdCardNo());
		params.put("win_info", tSdtPrentInfo.getWinInfo());
		params.put("award_name", tSdtPrentInfo.getAwardName());
		params.put("creater_id", tSdtPrentInfo.getCreaterId());
		params.put("creater_name", tSdtPrentInfo.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tSdtPrentInfo.getUpdaterId());
		params.put("updater_name", tSdtPrentInfo.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", tSdtPrentInfo.getDelSign());
		params.put("orignal_id", tSdtPrentInfo.getOrignalId());
		params.put("flow_status", tSdtPrentInfo.getOrignalId());
		params.put("business_type_id", tSdtPrentInfo.getOrignalId());
		params.put("isc_user_id", tSdtPrentInfo.getOrignalId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	//徒弟所获奖项添加
	@Override
	public void addSdtAwardInfo(TSdtAward tSdtAward) {
		String sql = "insert into t_sdt_award (id,item_type,item_id,award,sdt_td_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,orignal_id,flow_status,business_type_id,isc_user_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{item_type,jdbcType=VARCHAR},")
				.append("#{item_id,jdbcType=VARCHAR},").append("#{award,jdbcType=VARCHAR},")
				.append("#{sdt_td_id,jdbcType=VARCHAR},").append("#{creater_id,jdbcType=VARCHAR},")
				.append("#{creater_name,jdbcType=VARCHAR},").append("#{create_time,jdbcType=DATE},")
				.append("#{updater_id,jdbcType=VARCHAR},").append("#{updater_name,jdbcType=VARCHAR},")
				.append("#{update_time,jdbcType=DATE},").append("#{del_sign,jdbcType=INTEGER},")
				.append("#{orignal_id,jdbcType=VARCHAR},").append("#{flow_status,jdbcType=INTEGER},")
				.append("#{business_type_id,jdbcType=VARCHAR},").append("#{isc_user_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tSdtAward.getId());
		params.put("item_type", tSdtAward.getItemType());
		params.put("item_id", tSdtAward.getItemId());
		params.put("award", tSdtAward.getAward());
		params.put("sdt_td_id", tSdtAward.getSdtTdId());
		params.put("creater_id", tSdtAward.getCreaterId());
		params.put("creater_name", tSdtAward.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tSdtAward.getUpdaterId());
		params.put("updater_name", tSdtAward.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", 0);
		params.put("orignal_id", tSdtAward.getOrignalId());
		params.put("flow_status", tSdtAward.getOrignalId());
		params.put("business_type_id", tSdtAward.getOrignalId());
		params.put("isc_user_id", tSdtAward.getOrignalId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	//参与人员添加
	@Override
	public void addPartRank(TPartRank tPartRank) {
		String sql = "insert into t_part_rank (id,erp_no,user_name,id_card_no,item_id,item_type,rank,role,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{erp_no,jdbcType=VARCHAR},")
				.append("#{user_name,jdbcType=VARCHAR},").append("#{id_card_no,jdbcType=VARCHAR},")
				.append("#{item_id,jdbcType=VARCHAR},").append("#{item_type,jdbcType=VARCHAR},")
				.append("#{rank,jdbcType=INTEGER},").append("#{role,jdbcType=VARCHAR},")
				.append("#{del_sign,jdbcType=INTEGER},").append("#{is_valid,jdbcType=INTEGER},")
				.append("#{audit_state,jdbcType=INTEGER},").append("#{orignal_id,jdbcType=VARCHAR},")
				.append("#{flow_status,jdbcType=INTEGER},").append("#{business_type_id,jdbcType=VARCHAR},")
				.append("#{isc_user_id,jdbcType=INTEGER})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tPartRank.getId());
		params.put("erp_no", tPartRank.getErpNo());
		params.put("user_name", tPartRank.getUserName());
		params.put("id_card_no", tPartRank.getIdCardNo());
		params.put("item_id", tPartRank.getItemId());
		params.put("item_type", tPartRank.getItemType());
		params.put("rank", tPartRank.getRank());
		params.put("role", tPartRank.getRole());
		params.put("del_sign", 0);
		params.put("is_valid", tPartRank.getIsValid());
		params.put("audit_state", tPartRank.getAuditState());
		params.put("orignal_id", tPartRank.getOrignalId());
		params.put("flow_status", tPartRank.getOrignalId());
		params.put("business_type_id", tPartRank.getOrignalId());
		params.put("isc_user_id", tPartRank.getOrignalId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public TSdtTutorPrentInfo getSdtTutorPrentInfoById(String id) {
		String sql = "   select * from t_sdt_tutor_prent_info t where t.id = ? and t.del_sign = '0' " ;
		return this.findUnique(TSdtTutorPrentInfo.class, sql, new Object[] { id });
	}

	@Override
	public List<TSdtTutorPrentInfo> getSdtTutorPrentInfoByErpNo(String erpNo) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_sdt_tutor_prent_info t where t.is_valid='0' and t.del_sign = '0' ");
		List<String> arryList = new ArrayList<String>();
		if (StringUtils.isNotBlank(erpNo)) {
			sqlBuilder.append(" AND erp_no= ? ");
			arryList.add(erpNo);
		}
		sqlBuilder.append(" order by start_date desc");
		return this.findAllBySQL(TSdtTutorPrentInfo.class, sqlBuilder.toString(), null, false, arryList.toArray());
	}

	//师带徒根据徒弟表ID获取徒弟所获奖项
	@Override
	public List<TSdtAward> getSdtAwardBySdtTdId(String sdtTdId) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_sdt_award t where 1=1 ");
		List<String> arryList = new ArrayList<String>();
		sqlBuilder.append(" AND sdt_td_id= ? ");
		arryList.add(sdtTdId);
		return this.findAllBySQL(TSdtAward.class, sqlBuilder.toString(), null, false, arryList.toArray());
	}

    @Override
    public void findPageSdtTutorPrentInfoByCondi(Page<TSdtTutorPrentInfo> page, TSdtTutorPrentInfo tSdtTutorPrentInfo) {
		String sql = "   select * from t_sdt_tutor_prent_info t where t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);

		ArrayList<Object> arrayList = new ArrayList<Object>();
		if (!StringUtil.isNullOrEmpty(tSdtTutorPrentInfo.getErpNo())) {
			sqlBuilder.append(" AND erp_no= ? ");
			arrayList.add(tSdtTutorPrentInfo.getErpNo());
		}

		sqlBuilder.append(" order by start_date desc  ");
		this.findPageBySql(TSdtTutorPrentInfo.class, sqlBuilder.toString(), page, arrayList.toArray());
    }

    @Override
	public void addProjAchieveInfo(TProjAchieveInfo tProjAchieveInfo) {
		String sql = "insert into t_proj_achieve_info (id,start_date,end_date,proj_name,summary,encourage,proj_level,part_count,org_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{start_date,jdbcType=VARCHAR},")
				.append("#{end_date,jdbcType=VARCHAR},").append("#{proj_name,jdbcType=VARCHAR},")
				.append("#{summary,jdbcType=VARCHAR},").append("#{encourage,jdbcType=VARCHAR},")
				.append("#{proj_level,jdbcType=VARCHAR},").append("#{part_count,jdbcType=INTEGER},")
				.append("#{org_id,jdbcType=VARCHAR},").append("#{creater_id,jdbcType=VARCHAR},")
				.append("#{creater_name,jdbcType=VARCHAR},").append("#{create_time,jdbcType=DATE},")
				.append("#{updater_id,jdbcType=VARCHAR},").append("#{updater_name,jdbcType=VARCHAR},")
				.append("#{update_time,jdbcType=DATE},").append("#{del_sign,jdbcType=INTEGER},")
				.append("#{is_valid,jdbcType=INTEGER},").append("#{audit_state,jdbcType=INTEGER},")
				.append("#{orignal_id,jdbcType=VARCHAR},").append("#{flow_status,jdbcType=INTEGER},")
				.append("#{business_type_id,jdbcType=VARCHAR},").append("#{isc_user_id,jdbcType=VARCHAR},")
				.append("#{primitive_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tProjAchieveInfo.getId());
		params.put("start_date", tProjAchieveInfo.getStartDate());
		params.put("end_date", tProjAchieveInfo.getEndDate());
		params.put("proj_name", tProjAchieveInfo.getProjName());
		params.put("summary", tProjAchieveInfo.getSummary());
		params.put("encourage", tProjAchieveInfo.getEncourage());
		params.put("proj_level", tProjAchieveInfo.getProjLevel());
		params.put("part_count", tProjAchieveInfo.getPartCount());
		params.put("org_id", tProjAchieveInfo.getOrgId());
		params.put("creater_id", tProjAchieveInfo.getCreaterId());
		params.put("creater_name", tProjAchieveInfo.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tProjAchieveInfo.getUpdaterId());
		params.put("updater_name", tProjAchieveInfo.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", tProjAchieveInfo.getDelSign());
		params.put("is_valid", tProjAchieveInfo.getIsValid());
		params.put("audit_state", tProjAchieveInfo.getAuditState());
		params.put("orignal_id", tProjAchieveInfo.getOrignalId());
		params.put("flow_status",tProjAchieveInfo.getFlowStatus());
		params.put("business_type_id",tProjAchieveInfo.getBusinessTypeId());
		params.put("isc_user_id",tProjAchieveInfo.getIscUserId());
		params.put("primitive_id",tProjAchieveInfo.getPrimitiveId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public TProjAchieveInfoVo getProjAchieveInfoById(String id) {
		String sql = "   select t.*," +
				" GET_DIC('StandardLevel',t.proj_level) as proj_level_name " +
				" from t_proj_achieve_info t  " +
				" where t.id = ? and t.del_sign = '0' " ;
		return this.findUnique(TProjAchieveInfoVo.class, sql, new Object[] { id });
	}

	@Override
	public TProjAchieveInfo getProjAchieveInfoByIdForRecord(String id) {
		String sql = "   select t.* " +
				" from t_proj_achieve_info t  " +
				" where t.id = ? and t.del_sign = '0' " ;
		return this.findUnique(TProjAchieveInfo.class, sql, new Object[] { id });
	}

	@Override
	public List<TProjAchieveInfoVo> getProjAchieveInfoByErpNo(String erpNo) {
		String sql = "   select t.*,r.role,r.rank,r.erp_no, " +
				"  GET_DIC('XiangMuKeTiJS',r.role) as role_name, " +
				" GET_DIC('StandardLevel',t.proj_level) as proj_level_name " +
				" from t_part_rank r , t_proj_achieve_info t  " +
				" where r.item_id=t.id and r.item_type='17' and  t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);
		List<String> arryList = new ArrayList<String>();
		if (StringUtils.isNotBlank(erpNo)) {
			sqlBuilder.append(" AND erp_no= ? ");
			arryList.add(erpNo);
		}

		sqlBuilder.append(" order by start_date desc");
		return this.findAllBySQL(TProjAchieveInfoVo.class, sqlBuilder.toString(), null, false, arryList.toArray());
	}

    @Override
    public void findPageProjAchieveInfoByCondi(Page<TProjAchieveInfoVo> page, TProjAchieveInfo tProjAchieveInfo) {

		String sql = "   select t.*,r.role,r.rank,r.erp_no  " +
				" from t_part_rank r , t_proj_achieve_info t  " +
				" where r.item_id=t.id and r.item_type='17' and  t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);

		ArrayList<Object> arrayList = new ArrayList<Object>();

		StringBuilder erp_no_sb= new StringBuilder();

		if(!tProjAchieveInfo.gettPartRankList().isEmpty()){
			tProjAchieveInfo.gettPartRankList().forEach(tPartRank->{
				if(!StringUtil.isNullOrEmpty(tPartRank.getErpNo())){
					erp_no_sb.append(",'").append(tPartRank.getErpNo()).append("'");
				}
			});
		}

		if(!StringUtil.isNullOrEmpty(erp_no_sb.toString())){
			sqlBuilder.append(" AND r.erp_no in ( ").append(erp_no_sb.toString().substring(1)).append(" )");
			//arrayList.add(erp_no_sb.toString().substring(1));
		}
		sqlBuilder.append(" order by start_date desc ");
		this.findPageBySql(TProjAchieveInfoVo.class, sqlBuilder.toString(), page, null);

    }

    @Override
	public List<TMouldInfo> getMouldInfoList(TMouldInfo tMouldInfo) {
		StringBuilder sqlBuilder = new StringBuilder(
				"select ID,MOULD_NAME,TYPE,VALUE,SORT,EASY_NAME,DEL_SIGN,TAB_NAME ");
		sqlBuilder.append(" from t_mould_info where 1=1 and DEL_SIGN=0 and tab_name is not null ");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		if(tMouldInfo!=null) {
			if (!StringUtil.isNullOrEmpty(tMouldInfo.getId())) {
				sqlBuilder.append("and id=?");
				arrayList.add(tMouldInfo.getId());
			}
		}
		sqlBuilder.append(" order by SORT ");
		return this.findAllBySQL(TMouldInfo.class, sqlBuilder.toString(), null, false,
				arrayList.toArray());
	}

//	@Override
//	public List<EachTypeDetailVo> getEachTypeDetailList(EachTypeDetailVo detail) {
//		StringBuilder sqlBuilder = new StringBuilder(
//				"select * from "+detail.getTabName()+" where 1=1");
//		ArrayList<Object> arrayList = new ArrayList<Object>();
//		return this.findAllBySQL(EachTypeDetailVo.class, sqlBuilder.toString(), null, false,
//				arrayList.toArray());
//	}



	@Override
	public void getEachTypeDetailList(EachTypeDetailVo detail, Page<EachTypeDetailVo> page) {
		ArrayList<Object> arrayList = new ArrayList<Object>();
		StringBuilder sqlBuilder = new StringBuilder(
				"select * from "+detail.getTabName()+" where 1=1 ");
		if(!StringUtil.isNullOrEmpty(detail.getErpNo())) {
			sqlBuilder.append(" and erp_no=?");
			arrayList.add(detail.getErpNo());
		}
		this.findPageBySql(EachTypeDetailVo.class, sqlBuilder.toString(), page, arrayList.toArray());
	}

	@Override
	public List<SysDictionaryInfoVo> getAttendanceUserTypeByValue(String value) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_sys_dictionary_info where p_id=( ");
		sqlBuilder.append(" select id from t_sys_dictionary_info where value=?) order by value");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(value);
		return this.findAllBySQL(SysDictionaryInfoVo.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}

	@Override
	public  List<TPartRank> getTPartRankByMids(Set<String> mainIds, String type){
		if(mainIds.isEmpty()||StringUtil.isNullOrEmpty(type)){
			return null;
		}
		String idsStr="";
//		for(int i=0;i<mainIds.size();i++){
//			idsStr+=",'"+mainIds.get(i)+"'";
//		}
		for(String id:mainIds){
			idsStr+=",'"+id+"'";
		}

		idsStr=idsStr.substring(1);

		String jsCode="";
		if(type.equals("17")){
			jsCode="XiangMuKeTiJS";
		}else {
			jsCode="XueshuchengguoJs";
		}

//		String sql = " select t.id,t.erp_no,p.user_name,t.id_card_no,t.item_id,t.item_type,t.rank,t.role,t.del_sign,t.is_valid, " +
//				" t.audit_state,t.orignal_id,t.flow_status,t.business_type_id,t.isc_user_id , " +
//				" GET_DIC('"+ jsCode +"',t.role) as role_name from t_part_rank t left join isc_user i on t.erp_no=i.fax " ;

		String sql = " select t.* ,GET_DIC('"+ jsCode +"',t.role) as role_name from t_part_rank t  " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" where item_id in (").append(idsStr).append(") and item_type='").append(type).append("' order by item_type, rank ");
		return this.findAllBySQL(TPartRank.class, sqlBuilder.toString(), null, false,null);

	}

	public List<TSdtPrentInfo> getTSdtPrentInfoByMids(List<String> mainIds){

		if(mainIds.isEmpty()){
			return null;
		}
		String idsStr="";
		for(int i=0;i<mainIds.size();i++){
			idsStr+=",'"+mainIds.get(i)+"'";
		}

		idsStr=idsStr.substring(1);


//		String sql =" select t.id,t.sdt_id,t.erp_no,p.user_name,t.id_card_no,t.win_info,t.award_name, " +
//				" t.creater_id,t.creater_name,t.create_time,t.updater_id,t.updater_name,t.update_time,t.del_sign, " +
//				" t.orignal_id,t.flow_status,t.business_type_id,t.isc_user_id from t_sdt_prent_info t left join isc_user i on t.erp_no=i.fax " ;

		String sql =" select * from t_sdt_prent_info " ;

		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" where sdt_id in (").append(idsStr).append(")  order by erp_no ");

		return this.findAllBySQL(TSdtPrentInfo.class, sqlBuilder.toString(), null, false,null);

	}

	@Override
	public List<TSdtAward> getTSdtAwardByMids(List<String> mainIds) {
		if(mainIds.isEmpty()){
			return null;
		}
		String idsStr="";
		for(int i=0;i<mainIds.size();i++){
			idsStr+=",'"+mainIds.get(i)+"'";
		}

		idsStr=idsStr.substring(1);
		String sql =" select * from t_sdt_award " ;

		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" where sdt_td_id in (").append(idsStr).append(")  order by item_type ");

		return this.findAllBySQL(TSdtAward.class, sqlBuilder.toString(), null, false,null);
	}

	/**
	 * 根据师带徒ID获取徒弟信息
	 * @param sdtId
	 * @return
	 */
	public List<TSdtPrentInfo> getTSdtPrentInfoListById(String sdtId){
		if(sdtId.isEmpty()){
			return null;
		}
		String sql =" select * from t_sdt_prent_info " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" where sdt_id =? ");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(sdtId);
		return this.findAllBySQL(TSdtPrentInfo.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}


	/****************************************通过数据id判断当前数据是否存在待审核的副本数据********************************/

	@Override
	public List<TYearEffectInfo> getReadyYearEffectById(String id) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_year_effect_info where 1=1 ");
		sqlBuilder.append(" and orignal_id = ?");
		sqlBuilder.append(" and flow_status = 0");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(id);
		return this.findAllBySQL(TYearEffectInfo.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}

	@Override
	public List<TEducateInfo> getReadyEducateInfoById(String id) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_educate_info where 1=1 ");
		sqlBuilder.append(" and orignal_id = ?");
		sqlBuilder.append(" and flow_status = 0");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(id);
		return this.findAllBySQL(TEducateInfo.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}

	@Override
	public List<TProTecInfo> getReadyProTecInfoById(String id) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_pro_tec_info where 1=1 ");
		sqlBuilder.append(" and orignal_id = ?");
		sqlBuilder.append(" and flow_status = 0");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(id);
		return this.findAllBySQL(TProTecInfo.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}

	@Override
	public List<TSkillLevelInfo> getReadySkillLevelInfoById(String id) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_skill_level_info where 1=1 ");
		sqlBuilder.append(" and orignal_id = ?");
		sqlBuilder.append(" and flow_status = 0");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(id);
		return this.findAllBySQL(TSkillLevelInfo.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}

	@Override
	public List<TExpertTitleInfo> getReadyExpertTitleInfoById(String id) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_expert_title_info where 1=1 ");
		sqlBuilder.append(" and orignal_id = ?");
		sqlBuilder.append(" and flow_status = 0");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(id);
		return this.findAllBySQL(TExpertTitleInfo.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}

	@Override
	public List<TAcadeAchiveInfo> getReadyAcadeAchiveInfoById(String id) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_acade_achive_info where 1=1 ");
		sqlBuilder.append(" and orignal_id = ?");
		sqlBuilder.append(" and flow_status = 0");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(id);
		return this.findAllBySQL(TAcadeAchiveInfo.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}

	@Override
	public List<TStandInfo> getReadyStandInfoById(String id) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_stand_info where 1=1 ");
		sqlBuilder.append(" and orignal_id = ?");
		sqlBuilder.append(" and flow_status = 0");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(id);
		return this.findAllBySQL(TStandInfo.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}

	@Override
	public List<TPatentInfo> getReadyPatentInfoById(String id) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_patent_info where 1=1 ");
		sqlBuilder.append(" and orignal_id = ?");
		sqlBuilder.append(" and flow_status = 0");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(id);
		return this.findAllBySQL(TPatentInfo.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}

	@Override
	public List<TTecInnovInfo> getReadyTecInnovInfoById(String id) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_tec_innov_info where 1=1 ");
		sqlBuilder.append(" and orignal_id = ?");
		sqlBuilder.append(" and flow_status = 0");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(id);
		return this.findAllBySQL(TTecInnovInfo.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}

	@Override
	public List<TContestInfo> getReadyContestInfoById(String id) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_contest_info where 1=1 ");
		sqlBuilder.append(" and orignal_id = ?");
		sqlBuilder.append(" and flow_status = 0");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(id);
		return this.findAllBySQL(TContestInfo.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}

	@Override
	public List<TTecManInnov> getReadyTecManInnovById(String id) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_tec_man_innov where 1=1 ");
		sqlBuilder.append(" and orignal_id = ?");
		sqlBuilder.append(" and flow_status = 0");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(id);
		return this.findAllBySQL(TTecManInnov.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}

	@Override
	public List<THonorInfo> getReadyHonorInfoById(String id) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_honor_info where 1=1 ");
		sqlBuilder.append(" and orignal_id = ?");
		sqlBuilder.append(" and flow_status = 0");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(id);
		return this.findAllBySQL(THonorInfo.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}

	@Override
	public List<TWorkExpInfo> getReadyWorkExpInfoById(String id) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_work_exp_info where 1=1 ");
		sqlBuilder.append(" and orignal_id = ?");
		sqlBuilder.append(" and flow_status = 0");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(id);
		return this.findAllBySQL(TWorkExpInfo.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}

	@Override
	public List<TContiStudyInfo> getReadyContiStudyInfoById(String id) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_conti_study_info where 1=1 ");
		sqlBuilder.append(" and orignal_id = ?");
		sqlBuilder.append(" and flow_status = 0");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(id);
		return this.findAllBySQL(TContiStudyInfo.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}

	@Override
	public List<TSdtTutorPrentInfo> getReadySdtTutorPrentInfoById(String id) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_sdt_tutor_prent_info where 1=1 ");
		sqlBuilder.append(" and orignal_id = ?");
		sqlBuilder.append(" and flow_status = 0");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(id);
		return this.findAllBySQL(TSdtTutorPrentInfo.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}

	@Override
	public List<TProjAchieveInfo> getReadyProjAchieveInfoById(String id) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_proj_achieve_info where 1=1 ");
		sqlBuilder.append(" and orignal_id = ?");
		sqlBuilder.append(" and flow_status = 0");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(id);
		return this.findAllBySQL(TProjAchieveInfo.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}

	@Override
	public void deleteEmpBaseInfoByErpNo(String erpNo) {
		String sql = "UPDATE t_emp_base_info  SET ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		Map<String, Object> params = new HashMap<String, Object>();
		sqlBuilder.append(" del_sign = 1 ");
		sqlBuilder.append(" where 1=1 ");
		sqlBuilder.append(" and erp_no = #{erp_no,jdbcType=VARCHAR} ");
		params.put("erp_no",erpNo);
		this.executeSql(sqlBuilder.toString(), params);
	}

	/**
	 * 添加挂职轮岗信息
	 * @author yangwang
	 * @param tRotationInfo
	 *  */
	@Override
	public void addRotationInfo(TRotationInfo tRotationInfo) {
		String sql = "insert into t_rotation_info (id,erp_no,user_name,start_time,end_time,rotation_dept,rotation_org,rotation_post,org_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{erp_no,jdbcType=VARCHAR},")
				.append("#{user_name,jdbcType=VARCHAR},").append("#{start_time,jdbcType=DATE},")
				.append("#{end_time,jdbcType=DATE},").append("#{rotation_dept,jdbcType=VARCHAR},")
				.append("#{rotation_org,jdbcType=VARCHAR},").append("#{rotation_post,jdbcType=VARCHAR},")
				.append("#{org_id,jdbcType=VARCHAR},").append("#{creater_id,jdbcType=VARCHAR},")
				.append("#{creater_name,jdbcType=VARCHAR},").append("#{create_time,jdbcType=DATE},")
				.append("#{updater_id,jdbcType=VARCHAR},").append("#{updater_name,jdbcType=VARCHAR},")
				.append("#{update_time,jdbcType=DATE},").append("#{del_sign,jdbcType=INTEGER},")
				.append("#{is_valid,jdbcType=INTEGER},").append("#{audit_state,jdbcType=INTEGER},")
				.append("#{orignal_id,jdbcType=VARCHAR},").append("#{flow_status,jdbcType=INTEGER},")
				.append("#{business_type_id,jdbcType=VARCHAR},").append("#{isc_user_id,jdbcType=VARCHAR},")
				.append("#{primitive_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tRotationInfo.getId());
		params.put("erp_no", tRotationInfo.getErpNo());
		params.put("user_name", tRotationInfo.getUserName());
		params.put("start_time", tRotationInfo.getStartTime());
		params.put("end_time", tRotationInfo.getEndTime());
		params.put("rotation_dept", tRotationInfo.getRotationDept());
		params.put("rotation_org", tRotationInfo.getRotationOrg());
		params.put("rotation_post", tRotationInfo.getRotationPost());
		params.put("org_id", tRotationInfo.getOrgId());
		params.put("creater_id", tRotationInfo.getCreaterId());
		params.put("creater_name", tRotationInfo.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tRotationInfo.getUpdaterId());
		params.put("updater_name", tRotationInfo.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", tRotationInfo.getDelSign());
		params.put("is_valid", tRotationInfo.getIsValid());
		params.put("audit_state", tRotationInfo.getAuditState());
		params.put("orignal_id", tRotationInfo.getOrignalId());
		params.put("flow_status",tRotationInfo.getFlowStatus());
		params.put("business_type_id",tRotationInfo.getBusinessTypeId());
		params.put("isc_user_id",tRotationInfo.getIscUserId());
		params.put("primitive_id",tRotationInfo.getPrimitiveId());
		this.executeSql(sqlBuilder.toString(), params);
	}
	/**
	 * 根据id获取挂职轮岗信息
	 * @author yangwang
	 * @param id
	 * @return TRotationInfo
	 *  */
	@Override
	public TRotationInfo getRotationInfoById(String id) {
		String sql = "select id,start_time,end_time,rotation_dept,rotation_org,rotation_post,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" from t_rotation_info")
		.append(" where del_sign = '0'")
		.append(" and id= ?");

		return this.findUnique(TRotationInfo.class, sqlBuilder.toString(), new Object[] { id });
	}
	/**
	 * 获取挂职轮岗列表信息
	 * @author yangwang
	 * @param tRotationInfo
	 * @return List<TRotationInfo>
	 *  */
	@Override
	public List<TRotationInfo> getListRotationInfoByCondi(TRotationInfo tRotationInfo) {
		String sql = "select distinct id,start_time,end_time,rotation_dept,rotation_org,rotation_post,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" from t_rotation_info")
		.append(" where del_sign = '0'")
		.append(" and is_valid='0'");

		List<Object> paramList = new ArrayList<Object>();
		if(null != tRotationInfo) {
			if(StringUtils.isNotBlank(tRotationInfo.getRotationDept())) {
				sqlBuilder.append(" and rotation_dept LIKE concat('%',?,'%') ESCAPE '/'");
		        String replaceStr = tRotationInfo.getRotationDept().replaceAll("%", "/%").replaceAll("_", "/_");
		        paramList.add(replaceStr);
			}
			if(StringUtils.isNotBlank(tRotationInfo.getRotationOrg())) {
				sqlBuilder.append(" and rotation_org LIKE concat('%',?,'%') ESCAPE '/'");
		        String replaceStr = tRotationInfo.getRotationOrg().replaceAll("%", "/%").replaceAll("_", "/_");
		        paramList.add(replaceStr);
			}
			if(StringUtils.isNotBlank(tRotationInfo.getRotationPost())) {
				sqlBuilder.append(" and rotation_post LIKE concat('%',?,'%') ESCAPE '/'");
		        String replaceStr = tRotationInfo.getRotationPost().replaceAll("%", "/%").replaceAll("_", "/_");
		        paramList.add(replaceStr);
			}
			if(null != tRotationInfo.getStartTime()) {
				sqlBuilder.append(" and start_time >= ?");
    			paramList.add(new Timestamp(tRotationInfo.getStartTime().getTime()));
			}
			if(null != tRotationInfo.getEndTime()) {
				sqlBuilder.append(" and end_time <= ?");
    			paramList.add(new Timestamp(tRotationInfo.getEndTime().getTime()));
			}
		}

		sqlBuilder.append(" order by update_time desc");

		return this.findAllBySQL(TRotationInfo.class, sqlBuilder.toString(), null, false, paramList.toArray());
	}
	/**
	 * 获取挂职轮岗分页信息
	 * @author yangwang
	 * @param page
	 * @param tRotationInfo
	 *  */
	@Override
	public void findPageRotationInfoByCondi(Page<TRotationInfo> page,TRotationInfo tRotationInfo) {
		String sql = "select distinct id,start_time,end_time,rotation_dept,rotation_org,rotation_post,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" from t_rotation_info")
		.append(" where del_sign = '0'")
		.append(" and is_valid='0'");

		List<Object> paramList = new ArrayList<Object>();
		if(null != tRotationInfo) {
			if (!StringUtil.isNullOrEmpty(tRotationInfo.getErpNo())) {
				sqlBuilder.append(" AND erp_no= ? ");
				paramList.add(tRotationInfo.getErpNo());
			}
			if(StringUtils.isNotBlank(tRotationInfo.getRotationDept())) {
				sqlBuilder.append(" and rotation_dept LIKE concat('%',?,'%') ESCAPE '/'");
		        String replaceStr = tRotationInfo.getRotationDept().replaceAll("%", "/%").replaceAll("_", "/_");
		        paramList.add(replaceStr);
			}
			if(StringUtils.isNotBlank(tRotationInfo.getRotationOrg())) {
				sqlBuilder.append(" and rotation_org LIKE concat('%',?,'%') ESCAPE '/'");
		        String replaceStr = tRotationInfo.getRotationOrg().replaceAll("%", "/%").replaceAll("_", "/_");
		        paramList.add(replaceStr);
			}
			if(StringUtils.isNotBlank(tRotationInfo.getRotationPost())) {
				sqlBuilder.append(" and rotation_post LIKE concat('%',?,'%') ESCAPE '/'");
		        String replaceStr = tRotationInfo.getRotationPost().replaceAll("%", "/%").replaceAll("_", "/_");
		        paramList.add(replaceStr);
			}
			if(null != tRotationInfo.getStartTime()) {
				sqlBuilder.append(" and start_time >= ?");
    			paramList.add(new Timestamp(tRotationInfo.getStartTime().getTime()));
			}
			if(null != tRotationInfo.getEndTime()) {
				sqlBuilder.append(" and end_time <= ?");
    			paramList.add(new Timestamp(tRotationInfo.getEndTime().getTime()));
			}
		}

		sqlBuilder.append(" order by update_time desc");

		this.findPageBySql(TRotationInfo.class, sqlBuilder.toString(), page, paramList.toArray());
	}

	/**
	 * 获取挂职轮岗待审核信息
	 * @author yangwang
	 * @param id
	 * @return List<TRotationInfo>
	 *  */
	@Override
	public List<TRotationInfo> getReadyRotationInfoById(String id){
		String sql = "select distinct id,start_time,end_time,rotation_dept,rotation_org,rotation_post,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" from t_rotation_info")
		.append(" where flow_status = 0")
		.append(" and orignal_id = ?");
		return this.findAllBySQL(TRotationInfo.class, sqlBuilder.toString(), null, false, new Object[] {id});
	}

	/**
	 * 根据论文名称查询全部
	 * @param name
	 *  */
	@Override
	public List<TAcadeAchiveInfoVo> getAcadeAchiveInfoByAcadName(String name,String orgId){
		String sql = "select t.* ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" from t_acade_achive_info t")
				.append(" where t.flow_status <> 2 and t.del_sign = 0")
				.append(" and t.acad_name = ?")
				.append(" and t.org_id = ?");
		List<Object> paramList = new ArrayList<Object>();
		paramList.add(name);
		paramList.add(orgId);
		return this.findAllBySQL(TAcadeAchiveInfoVo.class, sqlBuilder.toString(), null, false, paramList.toArray());
	}

	/**
	 * 根据标准名称查询全部
	 * @param name
	 *  */
	@Override
	public List<TStandInfoVo> getStandInfoByName(String name,String orgId){
		String sql = "select t.* ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" from t_stand_info t")
				.append(" where t.flow_status <> 2 and t.del_sign = 0")
				.append(" and t.name = ?")
				.append(" and t.org_id = ?");
		List<Object> paramList = new ArrayList<Object>();
		paramList.add(name);
		paramList.add(orgId);
		return this.findAllBySQL(TStandInfoVo.class, sqlBuilder.toString(), null, false, paramList.toArray());
	}

	/**
	 * 根据专利名称查询全部
	 * @param name
	 *  */
	@Override
	public List<TPatentInfoVo> getPatentInfoByPatentName(String name,String orgId){
		String sql = "select t.* ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" from t_patent_info t")
				.append(" where t.flow_status <> 2 and t.del_sign = 0")
				.append(" and t.patent_name = ?")
				.append(" and t.org_id = ?");
		List<Object> paramList = new ArrayList<Object>();
		paramList.add(name);
		paramList.add(orgId);
		return this.findAllBySQL(TPatentInfoVo.class, sqlBuilder.toString(), null, false,paramList.toArray());
	}

	/**
	 * 根据成果名称查询全部
	 * @param name
	 *  */
	@Override
	public List<TTecInnovInfoVo> getTecInnovInfoByAchiName(String name,String orgId){
		String sql = "select t.* ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" from t_tec_innov_info t")
				.append(" where t.flow_status <> 2 and t.del_sign = 0")
				.append(" and t.achi_name = ?")
				.append(" and t.org_id = ?");
		List<Object> paramList = new ArrayList<Object>();
		paramList.add(name);
		paramList.add(orgId);
		return this.findAllBySQL(TTecInnovInfoVo.class, sqlBuilder.toString(), null, false,paramList.toArray());
	}

	/**
	 * 根据成果名称查询全部
	 * @param name
	 *  */
	@Override
	public List<TTecManInnovVo> getTecManInnovByAchiName(String name,String orgId){
		String sql = "select t.* ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" from t_tec_man_innov t")
				.append(" where t.flow_status <> 2 and t.del_sign = 0")
				.append(" and t.achi_name = ?")
				.append(" and t.org_id = ?");
		List<Object> paramList = new ArrayList<Object>();
		paramList.add(name);
		paramList.add(orgId);
		return this.findAllBySQL(TTecManInnovVo.class, sqlBuilder.toString(), null, false,paramList.toArray());
	}

	/**
	 * 根据成果名称查询全部
	 * @param name
	 *  */
	@Override
	public List<TProjAchieveInfoVo> getProjAchieveInfoByProjName(String name,String orgId){
		String sql = "select t.* ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" from t_proj_achieve_info t")
				.append(" where t.flow_status <> 2 and t.del_sign = 0")
				.append(" and t.proj_name = ?")
				.append(" and t.org_id = ?");
		List<Object> paramList = new ArrayList<Object>();
		paramList.add(name);
		paramList.add(orgId);
		return this.findAllBySQL(TProjAchieveInfoVo.class, sqlBuilder.toString(), null, false,paramList.toArray());
	}

	@Override
	public TEmpBaseInfoVo getNowBaseInfoByErpNo(String erpNo) {
		String sql = //" select id,erp_no,name,sex,GET_DIC('Gender',sex) as sex_name,birth_date,nation, " +
				" select t.*," +
				" GET_DIC('Nation',nation) as nation_name,politi_status, " +
                " GET_DIC('Gender',sex) as sex_name, " +
                " GET_DIC('PoliticalLandscapeText',politi_status) as politi_status_name, " +
                " mobile_phone,level,salary_grade,party_date,job_date,cur_post,real_post,future_post,GET_DIC('TalentTitle',emp_title) as emp_title_name,a.acqu_time from t_emp_base_info t ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" left join (select * from t_expert_title_info  where erp_no=? order by level_name asc limit 0,1) as a on t.erp_no=a.erp_no ");
		sqlBuilder.append(" where 1=1 ");
		sqlBuilder.append("  and t.erp_no= ?  and  t.is_valid='0' and t.del_sign = '0' ");
		List<Object> paramList = new ArrayList<Object>();
		paramList.add(erpNo);
		paramList.add(erpNo);
		return this.findUnique(TEmpBaseInfoVo.class, sqlBuilder.toString(), paramList.toArray());
	}

	@Override
	public FuturePostVo getFuturePostByErpNo(String erpNo) {
		String sql = " select future_post from t_emp_base_info where erp_no= ?" ;
		return this.findUnique(FuturePostVo.class, sql, new Object[] { erpNo });
	}

	@Override
	public void addGrowthPlan(TGrowthPlan tGrowthPlan, User user) {
		String sql = "insert into t_growth_plan (id,erp_no,user_name,dept_id,dept_name,start_date,end_date,future_post,other_case,ascension_situation,job,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{erp_no,jdbcType=VARCHAR},")
				.append("#{user_name,jdbcType=VARCHAR},").append("#{dept_id,jdbcType=VARCHAR},")
				.append("#{dept_name,jdbcType=DATE},").append("#{start_date,jdbcType=DATE},")
				.append("#{end_date,jdbcType=DATE},").append("#{future_post,jdbcType=VARCHAR},").append("#{other_case,jdbcType=VARCHAR},")
				.append("#{ascension_situation,jdbcType=VARCHAR},").append("#{job,jdbcType=VARCHAR},")
				.append("#{creater_id,jdbcType=VARCHAR},")
				.append("#{creater_name,jdbcType=VARCHAR},").append("#{create_time,jdbcType=DATE},")
				.append("#{updater_id,jdbcType=VARCHAR},").append("#{updater_name,jdbcType=VARCHAR},")
				.append("#{update_time,jdbcType=DATE},").append("#{del_sign,jdbcType=INTEGER},")
				.append("#{is_valid,jdbcType=INTEGER})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tGrowthPlan.getId());
		params.put("erp_no", tGrowthPlan.getErpNo());
		params.put("user_name", tGrowthPlan.getUserName());
		params.put("dept_id", tGrowthPlan.getDeptId());
		params.put("dept_name", tGrowthPlan.getDeptName());
		params.put("start_date", tGrowthPlan.getStartDate());
		params.put("end_date", tGrowthPlan.getEndDate());
		params.put("future_post", tGrowthPlan.getFuturePost());
		params.put("other_case", tGrowthPlan.getOtherCase());
		params.put("ascension_situation", tGrowthPlan.getAscensionSituation());
		params.put("job", tGrowthPlan.getJob());
		params.put("creater_id", user.getFax());
		params.put("creater_name", user.getName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", user.getFax());
		params.put("updater_name", user.getName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", 0);
		params.put("is_valid", 0);
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public void findPageGrowthPlanByCondi(Page<TGrowthPlan> page, TGrowthPlan tGrowthPlan) {
		String sql = "select id,erp_no,user_name,dept_id,dept_name,start_date,end_date,future_post,other_case,ascension_situation,job,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" from t_growth_plan")
		.append(" where del_sign = '0'")
		.append(" and is_valid='0'");

		List<Object> paramList = new ArrayList<Object>();
		if(null != tGrowthPlan) {
			if (!StringUtil.isNullOrEmpty(tGrowthPlan.getDeptId())) {
				sqlBuilder.append(" AND dept_id like concat('%',?,'%') ESCAPE '/' ");
				paramList.add(tGrowthPlan.getDeptId());
			}
			if(!StringUtil.isNullOrEmpty(tGrowthPlan.getUserName())) {
				sqlBuilder.append(" and user_name LIKE concat('%',?,'%') ESCAPE '/'");
		        String replaceStr = tGrowthPlan.getUserName().replaceAll("%", "/%").replaceAll("_", "/_");
		        paramList.add(replaceStr);
			}
			if(null != tGrowthPlan.getStartDate()) {
				sqlBuilder.append(" and start_date >= ?");
    			paramList.add(new Timestamp(tGrowthPlan.getStartDate().getTime()));
			}
			if(null != tGrowthPlan.getEndDate()) {
				sqlBuilder.append(" and start_date <= ?");
    			paramList.add(new Timestamp(tGrowthPlan.getEndDate().getTime()));
			}
		}

		sqlBuilder.append(" order by update_time desc");

		this.findPageBySql(TGrowthPlan.class, sqlBuilder.toString(), page, paramList.toArray());
	}

	@Override
	public TGrowthPlan getGrowthPlanById(String id) {
		String sql = "select id,erp_no,user_name,dept_id,dept_name,start_date,end_date,future_post,other_case,ascension_situation,job,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" from t_growth_plan")
		.append(" where del_sign = '0'")
		.append(" and is_valid='0'");
		sqlBuilder.append(" and id=?");
		return this.findUnique(TGrowthPlan.class, sqlBuilder.toString(), new Object[] { id });
	}

	@Override
	public void updateGrowthPlan(TGrowthPlan tGrowthPlan,User user) {
		String sql = "update t_growth_plan set ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("start_date=#{start_date,jdbcType=DATE},").append("end_date=#{end_date,jdbcType=DATE},")
				.append("future_post=#{future_post,jdbcType=VARCHAR},")
				.append("other_case=#{other_case,jdbcType=VARCHAR},")
				.append("ascension_situation=#{ascension_situation,jdbcType=VARCHAR},")
				.append("job=#{job,jdbcType=VARCHAR},")
				.append("updater_id=#{updater_id,jdbcType=VARCHAR},")
				.append("updater_name=#{updater_name,jdbcType=VARCHAR},").append("update_time=now()");
		sqlBuilder.append(" where 1=1 ");
		sqlBuilder.append(" and id = #{id,jdbcType=VARCHAR} ");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tGrowthPlan.getId());
		params.put("start_date", tGrowthPlan.getStartDate());
		params.put("end_date", tGrowthPlan.getEndDate());
		params.put("future_post", tGrowthPlan.getFuturePost());
		params.put("other_case", tGrowthPlan.getOtherCase());
		params.put("ascension_situation", tGrowthPlan.getAscensionSituation());
		params.put("job", tGrowthPlan.getJob());
		params.put("updater_id", user.getFax());
		params.put("updater_name", user.getName());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public List<TGrowthPlan> getListByCondition(TGrowthPlan tGrowthPlan, String ids) {
		String sql = "";

		sql = "select id,erp_no,user_name,dept_id,dept_name,start_date,end_date,future_post,other_case,ascension_situation,job,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid ";

		StringBuilder sqlbuilder = new StringBuilder(sql);
		sqlbuilder.append(" from t_growth_plan")
		.append(" where del_sign = '0'")
		.append(" and is_valid='0'");

		ArrayList<Object> arrayList = new ArrayList<Object>();
		if (!StringUtil.isNullOrEmpty(tGrowthPlan.getUserName())) {
			sqlbuilder.append(" AND user_name like concat('%',?,'%') ");
			arrayList.add(tGrowthPlan.getUserName());
		}
		if (!StringUtil.isNullOrEmpty(tGrowthPlan.getDeptId())) {
			sqlbuilder.append(" AND dept_id like concat('%',?,'%') ESCAPE '/' ");
			arrayList.add(tGrowthPlan.getDeptId());
		}
		if(null != tGrowthPlan.getStartDate()) {
			sqlbuilder.append(" and start_date >= ?");
			arrayList.add(new Timestamp(tGrowthPlan.getStartDate().getTime()));
		}
		if(null != tGrowthPlan.getEndDate()) {
			sqlbuilder.append(" and start_date <= ?");
			arrayList.add(new Timestamp(tGrowthPlan.getEndDate().getTime()));
		}
		if (!StringUtil.isNullOrEmpty(ids)) {
			sqlbuilder.append(" AND ID IN(" + ids + ")");
		}
		sqlbuilder.append(" order by update_time desc");
		return this.findAllBySQL(TGrowthPlan.class, sqlbuilder.toString(), null, false,
				arrayList.toArray());
	}

	@Override
	public void getPersonalPageGrowthPlanByErpNo(Page<TGrowthPlan> page, String erpNo) {
		String sql = "select id,erp_no,user_name,dept_id,dept_name,start_date,end_date,future_post,other_case,ascension_situation,job,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" from t_growth_plan")
		.append(" where del_sign = '0'")
		.append(" and is_valid='0'");

		List<Object> paramList = new ArrayList<Object>();
			if (!StringUtil.isNullOrEmpty(erpNo)) {
				sqlBuilder.append(" AND erp_no= ? ");
				paramList.add(erpNo);
			}
		sqlBuilder.append(" order by update_time desc");

		this.findPageBySql(TGrowthPlan.class, sqlBuilder.toString(), page, paramList.toArray());
	}

	@Override
	public DeptIdPathVo getDeptIdPathById(String deptId) {
		String sql = " select path from t_org_dept where 1=1 and id=?";
		return this.findUnique(DeptIdPathVo.class, sql, new Object[] { deptId });

	}

	@Override
	public void addEmployeeMobility(TEmployeeMobility tEmployeeMobility) {
		String sql = "insert into t_employee_mobility (id,erp_no,user_name,flow_mode,flow_area,flow_type,begin_time,end_time,org_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{erp_no,jdbcType=VARCHAR},")
				.append("#{user_name,jdbcType=VARCHAR},").append("#{flow_mode,jdbcType=VARCHAR},")
				.append("#{flow_area,jdbcType=DATE},").append("#{flow_type,jdbcType=VARCHAR},")
				.append("#{begin_time,jdbcType=VARCHAR},").append("#{end_time,jdbcType=VARCHAR},").append("#{org_id,jdbcType=VARCHAR},")
				.append("#{creater_id,jdbcType=VARCHAR},")
				.append("#{creater_name,jdbcType=VARCHAR},").append("#{create_time,jdbcType=DATE},")
				.append("#{updater_id,jdbcType=VARCHAR},").append("#{updater_name,jdbcType=VARCHAR},")
				.append("#{update_time,jdbcType=DATE},").append("#{del_sign,jdbcType=INTEGER},")
				.append("#{is_valid,jdbcType=INTEGER},").append("#{audit_state,jdbcType=INTEGER},").append("#{orignal_id,jdbcType=VARCHAR},")
		        .append("#{flow_status,jdbcType=INTEGER},").append("#{business_type_id,jdbcType=VARCHAR},")
				.append("#{isc_user_id,jdbcType=VARCHAR},").append("#{primitive_id,jdbcType=VARCHAR})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tEmployeeMobility.getId());
		params.put("erp_no", tEmployeeMobility.getErpNo());
		params.put("user_name", tEmployeeMobility.getUserName());
		params.put("flow_mode", tEmployeeMobility.getFlowMode());
		params.put("flow_area", tEmployeeMobility.getFlowArea());
		params.put("flow_type", tEmployeeMobility.getFlowType());
		params.put("begin_time", tEmployeeMobility.getBeginTime());
		params.put("end_time", tEmployeeMobility.getEndTime());
		params.put("org_id", tEmployeeMobility.getOrgId());

		params.put("creater_id", tEmployeeMobility.getErpNo());
		params.put("creater_name", tEmployeeMobility.getUserName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tEmployeeMobility.getErpNo());
		params.put("updater_name", tEmployeeMobility.getUserName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", tEmployeeMobility.getDelSign());
		params.put("is_valid", tEmployeeMobility.getIsValid());
		params.put("audit_state", tEmployeeMobility.getAuditState());
		params.put("orignal_id", tEmployeeMobility.getOrignalId());
		params.put("flow_status",tEmployeeMobility.getFlowStatus());
		params.put("business_type_id",tEmployeeMobility.getBusinessTypeId());
		params.put("isc_user_id",tEmployeeMobility.getIscUserId());
		params.put("primitive_id",tEmployeeMobility.getPrimitiveId());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public void findPageEmployeeMobilityByCondi(Page<TEmployeeMobility> page, TEmployeeMobility tEmployeeMobility) {
		String sql = "  select t.* " +
                " from t_employee_mobility t  where t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);

		ArrayList<Object> arrayList = new ArrayList<Object>();
        if (!StringUtil.isNullOrEmpty(tEmployeeMobility.getErpNo())) {
            sqlBuilder.append(" AND erp_no= ? ");
            arrayList.add(tEmployeeMobility.getErpNo());
        }

		sqlBuilder.append(" order by update_time desc  ");
		this.findPageBySql(TEmployeeMobility.class, sqlBuilder.toString(), page, arrayList.toArray());
	}

	@Override
	public void getPersonalPageEmployeeMobilityByErpNo(Page<TEmployeeMobility> page, String erpNo) {
		String sql = "select id,erp_no,user_name,flow_mode,flow_area,flow_type,begin_time,end_time,org_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" from t_employee_mobility")
		.append(" where del_sign = '0'")
		.append(" and is_valid='0'");

		List<Object> paramList = new ArrayList<Object>();
			if (!StringUtil.isNullOrEmpty(erpNo)) {
				sqlBuilder.append(" AND erp_no= ? ");
				paramList.add(erpNo);
			}
		sqlBuilder.append(" order by update_time desc");

		this.findPageBySql(TEmployeeMobility.class, sqlBuilder.toString(), page, paramList.toArray());
	}

	@Override
	public void updateEmployeeMobility(TEmployeeMobility tEmployeeMobility, User user) {
		StringBuilder sqlBuilder = new StringBuilder("update t_employee_mobility_drafts set ");
		sqlBuilder.append("flow_mode = #{flow_mode,jdbcType=VARCHAR},")
				.append("flow_area = #{flow_area,jdbcType=VARCHAR},").append("flow_type = #{flow_type,jdbcType=VARCHAR},")
				.append("begin_time = #{begin_time,jdbcType=DATE},").append("end_time = #{end_time,jdbcType=DATE},")
				.append("updater_id = creater_id,").append("updater_name = creater_name,")
				.append("update_time = #{update_time,jdbcType=DATE} ").append("where id = #{id,jdbcType=VARCHAR}");
		HashMap<String, Object> params = new HashMap<>();
		params.put("id",tEmployeeMobility.getId());
		params.put("flow_mode",tEmployeeMobility.getFlowMode());
		params.put("flow_area",tEmployeeMobility.getFlowArea());
		params.put("flow_type",tEmployeeMobility.getFlowType());
		params.put("begin_time",tEmployeeMobility.getBeginTime());
		params.put("end_time",tEmployeeMobility.getEndTime());
		params.put("update_time",LocalDateTime.now());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public TEmployeeMobility getEmployeeMobilityById(String id) {
		String sql = "select t.*,\n" +
				"GET_DIC('FlowMode',flow_mode) as flow_mode_str,\n" +
				"GET_DIC('FlowArea',flow_area) as flow_area_str,\n" +
				"GET_DIC('FlowType',flow_type) as flow_type_str from t_employee_mobility t where del_sign = '0' and id=?";
		return this.findUnique(TEmployeeMobility.class, sql, id);
	}


	/****************************************通过数据id判断当前数据是否存在待审核的副本数据********************************/

	@Override
	public List<TEmployeeMobility> getReadyEmployeeMobilityById(String id) {
		StringBuilder sqlBuilder = new StringBuilder("select * from t_employee_mobility where 1=1 ");
		sqlBuilder.append(" and orignal_id = ?");
		sqlBuilder.append(" and flow_status = 0");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(id);
		return this.findAllBySQL(TEmployeeMobility.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}

	/**
	 * 获取技术标准信息
	 * @author pengmengzhi
	 * @param tecStandardInfo
	 * @return List<TRotationInfo>
	 *  */
	@Override
	public void findPageTecStandardInfoByCondi(Page<TTecStandardInfo> page, TTecStandardInfo tecStandardInfo){
		String sql = "  select t.*,r.role,r.erp_no" +
				" from t_part_rank r , t_tec_standard_info t  " +
				" where r.item_id=t.id and r.item_type='21' and  t.is_valid='0' and t.del_sign = '0' " ;
		StringBuilder sqlBuilder = new StringBuilder(sql);

		StringBuilder erp_no_sb= new StringBuilder();

		if(!tecStandardInfo.gettPartRankList().isEmpty()){
			tecStandardInfo.gettPartRankList().forEach(tPartRank->{
				if(!StringUtil.isNullOrEmpty(tPartRank.getErpNo())){
					erp_no_sb.append(",'").append(tPartRank.getErpNo()).append("'");
				}
			});
		}

		if(!StringUtil.isNullOrEmpty(erp_no_sb.toString())){
			sqlBuilder.append(" AND r.erp_no in ( ").append(erp_no_sb.toString().substring(1)).append(" )");
			//arrayList.add(erp_no_sb.toString().substring(1));
		}
		sqlBuilder.append(" order by update_time desc ");
		this.findPageBySql(TTecStandardInfo.class, sqlBuilder.toString(), page, null);
	}

	@Override
	public TTecStandardInfo getTecStandardInfoById(String id){
		String sql = " select t.*, " +
				" GET_DIC('tecStandardType',t.standard_Type) as standard_Type_str " +
				" from t_tec_standard_info t " +
				" where t.id= ? and t.del_sign = '0' " ;
		return this.findUnique(TTecStandardInfo.class, sql, new Object[] { id });
	}

	@Override
	public void addTecStandardInfo(TTecStandardInfo tecStandardInfo){
		String sql = "insert into t_tec_standard_info (id,standard_name,standard_type,summary,award_date,part_count,org_id,creater_id,creater_name,create_time,updater_id,updater_name,update_time,del_sign,is_valid,audit_state,orignal_id,flow_status,business_type_id,isc_user_id,primitive_id,post_time) values ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append("(#{id,jdbcType=VARCHAR},").append("#{standard_name,jdbcType=VARCHAR},")
				.append("#{standard_type,jdbcType=VARCHAR},").append("#{summary,jdbcType=VARCHAR},")
				.append("#{award_date,jdbcType=DATE},").append("#{part_count,jdbcType=VARCHAR},")
				.append("#{org_id,jdbcType=VARCHAR},").append("#{creater_id,jdbcType=VARCHAR},")
				.append("#{creater_name,jdbcType=VARCHAR},").append("#{create_time,jdbcType=DATE},")
				.append("#{updater_id,jdbcType=VARCHAR},").append("#{updater_name,jdbcType=VARCHAR},")
				.append("#{update_time,jdbcType=DATE},").append("#{del_sign,jdbcType=INTEGER},")
				.append("#{is_valid,jdbcType=INTEGER},").append("#{audit_state,jdbcType=INTEGER},")
				.append("#{orignal_id,jdbcType=VARCHAR},").append("#{flow_status,jdbcType=INTEGER},")
				.append("#{business_type_id,jdbcType=VARCHAR},").append("#{isc_user_id,jdbcType=VARCHAR},")
				.append("#{primitive_id,jdbcType=VARCHAR},").append("#{post_time,jdbcType=DATE})");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", tecStandardInfo.getId());
		params.put("standard_name", tecStandardInfo.getStandardName());
		params.put("standard_type", tecStandardInfo.getStandardType());
		params.put("summary", tecStandardInfo.getSummary());
		params.put("award_date", tecStandardInfo.getAwardDate());
		params.put("part_count", tecStandardInfo.getPartCount());
		params.put("org_id", tecStandardInfo.getOrgId());
		params.put("creater_id", tecStandardInfo.getCreaterId());
		params.put("creater_name", tecStandardInfo.getCreaterName());
		params.put("create_time", new Timestamp(new Date().getTime()));
		params.put("updater_id", tecStandardInfo.getUpdaterId());
		params.put("updater_name", tecStandardInfo.getUpdaterName());
		params.put("update_time", new Timestamp(new Date().getTime()));
		params.put("del_sign", 0);
		params.put("is_valid", tecStandardInfo.getIsValid());
		params.put("audit_state", tecStandardInfo.getAuditState());
		params.put("orignal_id", tecStandardInfo.getOrignalId());
		params.put("flow_status",tecStandardInfo.getFlowStatus());
		params.put("business_type_id",tecStandardInfo.getBusinessTypeId());
		params.put("isc_user_id",tecStandardInfo.getIscUserId());
		params.put("primitive_id",tecStandardInfo.getPrimitiveId());
		params.put("post_time",tecStandardInfo.getPostTime());
		this.executeSql(sqlBuilder.toString(), params);
	}

	@Override
	public TTecStandardInfo getTecStandardInfoByIdForRecord(String id){
		String sql = " select t.* " +
				" from t_tec_standard_info t " +
				" where t.id= ? and t.del_sign = '0' " ;
		return this.findUnique(TTecStandardInfo.class, sql, new Object[] { id });
	}

	@Override
	public List<TTecStandardInfo> getReadyTecStandardInfoById(String id){
		StringBuilder sqlBuilder = new StringBuilder("select * from t_tec_standard_info where 1=1 ");
		sqlBuilder.append(" and orignal_id = ?");
		sqlBuilder.append(" and flow_status = 0");
		ArrayList<Object> arrayList = new ArrayList<Object>();
		arrayList.add(id);
		return this.findAllBySQL(TTecStandardInfo.class, sqlBuilder.toString(), null, false, arrayList.toArray());
	}

	@Override
	public List<TTecStandardInfo> getTecStandardInfoByAcadName(String name,String orgId){
		String sql = "select t.* ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" from t_tec_standard_info t")
				.append(" where t.flow_status <> 2 and t.del_sign = 0")
				.append(" and t.standard_name = ?")
				.append(" and t.org_id = ?");
		List<Object> paramList = new ArrayList<Object>();
		paramList.add(name);
		paramList.add(orgId);
		return this.findAllBySQL(TTecStandardInfo.class, sqlBuilder.toString(), null, false, paramList.toArray());
	}


	@Override
	public List<TSalaryBusinessBind> selectSalaryBusinessBind(String businessTypeId,String itemId){
		String sql = " SELECT sbb.* from t_salary_business_bind sbb LEFT JOIN t_salary_info si on sbb.salary_id = si.id ";
		StringBuilder sqlBuilder = new StringBuilder(sql);
		sqlBuilder.append(" WHERE  sbb.business_type_id = ? ");
		sqlBuilder.append(" and sbb.item_id = ? ");
		sqlBuilder.append(" and si.audit_status !=2 ");
		List<String> list = new ArrayList<>();
		list.add(businessTypeId);
		list.add(itemId);
		return this.findAllBySQL(TSalaryBusinessBind.class,sqlBuilder.toString(),null,false,list.toArray());
	}
}
